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 <F5> <C-R>=ListMonths()<CR>
  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\<f5>\<down>\<enter>\<esc>", 'tx')
!     call assert_equal('February', getline(1))
!     %d
!     let g:setting = 'noinsertmode'
!     call feedkeys("a\<f5>\<down>\<enter>\<esc>", 'tx')
!     call assert_equal('February', getline(1))
!     call assert_false(pumvisible())
!     %d
!     let g:setting = ''
!     call feedkeys("a\<f5>". repeat("\<c-n>",12)."\<enter>\<esc>", 'tx')
!     call assert_equal('', getline(1))
!     %d
!     call feedkeys("a\<f5>\<c-p>\<enter>\<esc>", 'tx')
!     call assert_equal('', getline(1))
!     %d
!     call feedkeys("a\<f5>\<c-p>\<c-p>\<enter>\<esc>", 'tx')
!     call assert_equal('December', getline(1))
!     bwipe!
  endfunc
--- 12,56 ----
  endfunc
  
  func! Test_popup_completion_insertmode()
!   new
!   inoremap <F5> <C-R>=ListMonths()<CR>
! 
!   call feedkeys("a\<f5>\<down>\<enter>\<esc>", 'tx')
!   call assert_equal('February', getline(1))
!   %d
!   let g:setting = 'noinsertmode'
!   call feedkeys("a\<f5>\<down>\<enter>\<esc>", 'tx')
!   call assert_equal('February', getline(1))
!   call assert_false(pumvisible())
!   %d
!   let g:setting = ''
!   call feedkeys("a\<f5>". repeat("\<c-n>",12)."\<enter>\<esc>", 'tx')
!   call assert_equal('', getline(1))
!   %d
!   call feedkeys("a\<f5>\<c-p>\<enter>\<esc>", 'tx')
!   call assert_equal('', getline(1))
!   %d
!   call feedkeys("a\<f5>\<c-p>\<c-p>\<enter>\<esc>", 'tx')
!   call assert_equal('December', getline(1))
! 
!   bwipe!
!   iunmap <F5>
! endfunc
! 
! function! ComplTest() abort
!   call complete(1, ['source', 'soundfold'])
!   return ''
! endfunction
! 
! func Test_noinsert_complete()
!   new
!   set completeopt+=noinsert
!   inoremap <F5>  <C-R>=ComplTest()<CR>
!   call feedkeys("i\<F5>soun\<CR>\<CR>\<ESC>.", 'tx')
!   call assert_equal('soundfold', getline(1))
!   call assert_equal('soundfold', getline(2))
! 
!   bwipe!
!   set completeopt-=noinsert
!   iunmap <F5>
  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 -- b...@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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui