Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
patch 8.0.1672: error during completion causes command to be cancelled
Problem:    Error during completion causes command to be cancelled.
Solution:   Reset did_emsg before waiting for another character. (Tom M.)
  • Loading branch information
brammool committed Apr 7, 2018
1 parent 22efba4 commit 72532d3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ex_getln.c
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions src/testdir/test_cmdline.vim
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -762,6 +762,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1672,
/**/
1671,
/**/
Expand Down

0 comments on commit 72532d3

Please sign in to comment.