diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-04-07 19:09:09 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-04-07 19:09:09 +0200 |
commit | 72532d354e699f1cceec34c0b08e1de4d3ea9641 (patch) | |
tree | de2c28d5bd4a630b7e1c3225dff7204df9613e36 | |
parent | 22efba47deb7e504142487fdc1617ec638cf0683 (diff) |
patch 8.0.1672: error during completion causes command to be cancelledv8.0.1672
Problem: Error during completion causes command to be cancelled.
Solution: Reset did_emsg before waiting for another character. (Tom M.)
-rw-r--r-- | src/ex_getln.c | 4 | ||||
-rw-r--r-- | src/testdir/test_cmdline.vim | 11 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 48cccf18e0..9fdfac5a28 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -426,6 +426,10 @@ getcmdline( #endif quit_more = FALSE; /* reset after CTRL-D which had a more-prompt */ + did_emsg = FALSE; /* There can't really be a reason why an error + that occurs while typing a command should + cause the command not to be executed. */ + cursorcmd(); /* set the cursor on the right spot */ /* Get a character. Ignore K_IGNORE and K_NOP, they should not do diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 8755fbf1aa..ff0756c392 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -316,6 +316,17 @@ func Test_paste_in_cmdline() call feedkeys(":\<C-\>etoupper(getline(1))\<CR>\<C-B>\"\<CR>", 'tx') call assert_equal('"ASDF.X /TMP/SOME VERYLONGWORD A;B-C*D ', @:) bwipe! + + " Error while typing a command used to cause that it was not executed + " in the end. + new + try + call feedkeys(":file \<C-R>%Xtestfile\<CR>", 'tx') + catch /^Vim\%((\a\+)\)\=:E32/ + " ignore error E32 + endtry + call assert_equal("Xtestfile", bufname("%")) + bwipe! endfunc func Test_remove_char_in_cmdline() diff --git a/src/version.c b/src/version.c index 8264bd9a8a..665c953916 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1672, +/**/ 1671, /**/ 1670, |