]> granicus.if.org Git - vim/commitdiff
patch 8.0.0042 v8.0.0042
authorBram Moolenaar <Bram@vim.org>
Mon, 17 Oct 2016 18:47:02 +0000 (20:47 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 17 Oct 2016 18:47:02 +0000 (20:47 +0200)
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.

src/edit.c
src/testdir/test_popup.vim
src/version.c

index 53b43c485adf9bca79557f0d7ad33c4001cfb93d..776a420f27d08e2d3a2e23e174e15d5db8b04062 100644 (file)
@@ -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);
index 38459b323e54effacce1bd88dc70d3c48115f7be..d037b7abd94a2b4060f4d9e17bc297b7225aedf2 100644 (file)
@@ -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!
index 4902d69f09d0275f778970bbd5683d5843d68561..3a2b1a5e048cb2a02a139aa80f2a190d97125800 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    42,
 /**/
     41,
 /**/