]> granicus.if.org Git - vim/commitdiff
patch 8.0.0127 v8.0.0127
authorBram Moolenaar <Bram@vim.org>
Fri, 9 Dec 2016 18:36:56 +0000 (19:36 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 9 Dec 2016 18:36:56 +0000 (19:36 +0100)
Problem:    Cancelling completion still inserts text when formatting is done
            for 'textwidth'. (lacygoill)
Solution:   Don't format when CTRL-E was typed. (Hirohito Higashi,
            closes #1312)

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

index 0d9e9d4a48064a3a3730c25be6d47e9cf2131b28..51a12b3301b2fb90026413caebd0aa9bc6cacd0e 100644 (file)
@@ -3875,7 +3875,7 @@ ins_compl_prep(int c)
                if (prev_col > 0)
                    dec_cursor();
                /* only format when something was inserted */
-               if (!arrow_used && !ins_need_undo)
+               if (!arrow_used && !ins_need_undo && c != Ctrl_E)
                    insertchar(NUL, 0, -1);
                if (prev_col > 0
                             && ml_get_curline()[curwin->w_cursor.col] != NUL)
index f1e2c98c4762fa46aad1a18db43b92c566732119..96c8d7e30ab45d8f4cb84fde53d8ae8048838ac7 100644 (file)
@@ -464,4 +464,22 @@ func Test_completefunc_with_scratch_buffer()
   set completeopt&
 endfunc
 
+" <C-E> - select original typed text before the completion started without
+" auto-wrap text.
+func Test_completion_ctrl_e_without_autowrap()
+  new
+  let tw_save=&tw
+  set tw=78
+  let li = [
+        \ '"                                                        zzz',
+        \ '" zzzyyyyyyyyyyyyyyyyyyy']
+  call setline(1, li)
+  0
+  call feedkeys("A\<C-X>\<C-N>\<C-E>\<Esc>", "tx")
+  call assert_equal(li, getline(1, '$'))
+
+  let &tw=tw_save
+  q!
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index 3cd19f1774020a3778873a8fc1613b412171bbe9..39538a0c83497ad02e16bdcf61982487ef0c618d 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    127,
 /**/
     126,
 /**/