To: vim_dev@googlegroups.com Subject: Patch 8.0.0127 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0127 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) Files: src/edit.c, src/testdir/test_popup.vim *** ../vim-8.0.0126/src/edit.c 2016-11-10 20:01:41.185582969 +0100 --- src/edit.c 2016-12-09 19:35:16.822297340 +0100 *************** *** 3875,3881 **** if (prev_col > 0) dec_cursor(); /* only format when something was inserted */ ! if (!arrow_used && !ins_need_undo) insertchar(NUL, 0, -1); if (prev_col > 0 && ml_get_curline()[curwin->w_cursor.col] != NUL) --- 3875,3881 ---- if (prev_col > 0) dec_cursor(); /* only format when something was inserted */ ! 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) *** ../vim-8.0.0126/src/testdir/test_popup.vim 2016-10-29 14:37:51.970378370 +0200 --- src/testdir/test_popup.vim 2016-12-09 19:35:16.822297340 +0100 *************** *** 464,467 **** --- 464,485 ---- set completeopt& endfunc + " - 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\\\\", "tx") + call assert_equal(li, getline(1, '$')) + + let &tw=tw_save + q! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.0.0126/src/version.c 2016-12-09 19:28:33.580993178 +0100 --- src/version.c 2016-12-09 19:35:41.894129823 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 127, /**/ -- From "know your smileys": 8-O "Omigod!!" (done "rm -rf *" ?) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///