From 5395dd62097109236ff3e6473fb90d9560a6fd94 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 6 Jan 2019 19:52:34 -0500 Subject: vim-patch:8.1.0696: when test_edit fails 'insertmode' may not be reset 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 vim/vim#3768) https://github.com/vim/vim/commit/8ad16da7290190f55f88073d5586dfe133fddf45 --- src/nvim/testdir/runtest.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index 4fe7db135b..bfd6240f0c 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/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") " Check that the screen size is at least 24 x 80 characters. @@ -130,6 +130,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() -- cgit