diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-06 15:29:57 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-06 15:29:57 +0100 |
commit | 8ad16da7290190f55f88073d5586dfe133fddf45 (patch) | |
tree | 41188d4134f13d2a85a4aaff0220ced1d8a4670c /src/testdir | |
parent | f42b45d719e03218735b3c2845a74dca9c0efd60 (diff) | |
download | vim-git-8ad16da7290190f55f88073d5586dfe133fddf45.tar.gz |
patch 8.1.0696: when test_edit fails 'insertmode' may not be resetv8.1.0696
Problem: When test_edit fails 'insertmode' may not be reset and the next
test may get stuck. (James McCoy)
Solution: Always reset 'insertmode' after executing a test. Avoid that an
InsertCharPre autocommand or a 'complete' function can change the
state. (closes #3768)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/runtest.vim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index 89c1e3a5e..a8b43aaed 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -26,7 +26,7 @@ " It will be called after each Test_ function. " " When debugging a test it can be useful to add messages to v:errors: -" call add(v:errors, "this happened") +" call add(v:errors, "this happened") " Without the +eval feature we can't run these tests, bail out. @@ -149,6 +149,10 @@ func RunTheTest(test) endtry endif + " In case 'insertmode' was set and something went wrong, make sure it is + " reset to avoid trouble with anything else. + set noinsertmode + if exists("*TearDown") try call TearDown() |