To: vim_dev@googlegroups.com Subject: Patch 7.4.2013 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2013 Problem: Using "noinsert" in 'completeopt' breaks redo. Solution: Set compl_curr_match. (Shougo, closes #874) Files: src/edit.c, src/testdir/test_popup.vim *** ../vim-7.4.2012/src/edit.c 2016-06-26 18:37:51.886998663 +0200 --- src/edit.c 2016-07-09 21:44:23.638200049 +0200 *************** *** 4680,4685 **** --- 4680,4686 ---- EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO])); } set_vim_var_dict(VV_COMPLETED_ITEM, dict); + compl_curr_match = compl_shown_match; } /* *** ../vim-7.4.2012/src/testdir/test_popup.vim 2016-06-26 18:37:51.890998592 +0200 --- src/testdir/test_popup.vim 2016-07-09 21:44:16.530306369 +0200 *************** *** 1,6 **** " Test for completion menu - inoremap =ListMonths() let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] let g:setting = '' --- 1,5 ---- *************** *** 13,35 **** endfunc func! Test_popup_completion_insertmode() ! new ! call feedkeys("a\\\\", 'tx') ! call assert_equal('February', getline(1)) ! %d ! let g:setting = 'noinsertmode' ! call feedkeys("a\\\\", 'tx') ! call assert_equal('February', getline(1)) ! call assert_false(pumvisible()) ! %d ! let g:setting = '' ! call feedkeys("a\". repeat("\",12)."\\", 'tx') ! call assert_equal('', getline(1)) ! %d ! call feedkeys("a\\\\", 'tx') ! call assert_equal('', getline(1)) ! %d ! call feedkeys("a\\\\\", 'tx') ! call assert_equal('December', getline(1)) ! bwipe! endfunc --- 12,56 ---- endfunc func! Test_popup_completion_insertmode() ! new ! inoremap =ListMonths() ! ! call feedkeys("a\\\\", 'tx') ! call assert_equal('February', getline(1)) ! %d ! let g:setting = 'noinsertmode' ! call feedkeys("a\\\\", 'tx') ! call assert_equal('February', getline(1)) ! call assert_false(pumvisible()) ! %d ! let g:setting = '' ! call feedkeys("a\". repeat("\",12)."\\", 'tx') ! call assert_equal('', getline(1)) ! %d ! call feedkeys("a\\\\", 'tx') ! call assert_equal('', getline(1)) ! %d ! call feedkeys("a\\\\\", 'tx') ! call assert_equal('December', getline(1)) ! ! bwipe! ! iunmap ! endfunc ! ! function! ComplTest() abort ! call complete(1, ['source', 'soundfold']) ! return '' ! endfunction ! ! func Test_noinsert_complete() ! new ! set completeopt+=noinsert ! inoremap =ComplTest() ! call feedkeys("i\soun\\\.", 'tx') ! call assert_equal('soundfold', getline(1)) ! call assert_equal('soundfold', getline(2)) ! ! bwipe! ! set completeopt-=noinsert ! iunmap endfunc *** ../vim-7.4.2012/src/version.c 2016-07-09 19:20:54.674656045 +0200 --- src/version.c 2016-07-09 21:48:42.686325506 +0200 *************** *** 760,761 **** --- 760,763 ---- { /* Add new patch number below this line */ + /**/ + 2013, /**/ -- hundred-and-one symptoms of being an internet addict: 254. You wake up daily with your keyboard printed on your forehead. /// 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 ///