Skip to content

Commit

Permalink
patch 8.0.0042
Browse files Browse the repository at this point in the history
Problem:    When using Insert mode completion with 'completeopt' containing
            "noinsert" change is not saved for undo.  (Tommy Allen)
Solution:   Call stop_arrow() before inserting for pressing Enter.
  • Loading branch information
brammool committed Oct 17, 2016
1 parent 869e352 commit cbd3bd6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/edit.c
Expand Up @@ -857,8 +857,9 @@ edit(

/* Pressing CTRL-Y selects the current match. When
* compl_enter_selects is set the Enter key does the same. */
if (c == Ctrl_Y || (compl_enter_selects
&& (c == CAR || c == K_KENTER || c == NL)))
if ((c == Ctrl_Y || (compl_enter_selects
&& (c == CAR || c == K_KENTER || c == NL)))
&& stop_arrow() == OK)
{
ins_compl_delete();
ins_compl_insert(FALSE);
Expand Down
7 changes: 7 additions & 0 deletions src/testdir/test_popup.vim
Expand Up @@ -420,6 +420,13 @@ func Test_complete_no_undo()
call feedkeys("u", 'xt')
call assert_equal('', getline(2))

call feedkeys("ibbb\<Esc>0", 'xt')
call assert_equal('bbb', getline(2))
call feedkeys("A\<Right>\<Down>\<CR>\<Esc>", 'xt')
call assert_equal('January', getline(2))
call feedkeys("u", 'xt')
call assert_equal('bbb', getline(2))

iunmap <Right>
set completeopt&
q!
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -764,6 +764,8 @@ static char *(features[]) =

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

0 comments on commit cbd3bd6

Please sign in to comment.