diff options
Diffstat (limited to 'src/testdir/test_ins_complete.vim')
-rw-r--r-- | src/testdir/test_ins_complete.vim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 48589ce188..61c8ac7643 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -2586,6 +2586,37 @@ func Test_complete_fuzzy_match() call feedkeys("A\<C-X>\<C-N>\<Esc>0", 'tx!') call assert_equal('hello help hero h', getline('.')) + set completeopt=fuzzycollect + call setline(1, ['xyz yxz x']) + call feedkeys("A\<C-X>\<C-N>\<Esc>0", 'tx!') + call assert_equal('xyz yxz xyz', getline('.')) + " can fuzzy get yxz when use Ctrl-N twice + call setline(1, ['xyz yxz x']) + call feedkeys("A\<C-X>\<C-N>\<C-N>\<Esc>0", 'tx!') + call assert_equal('xyz yxz yxz', getline('.')) + + call setline(1, ['one two o']) + call feedkeys("A\<C-X>\<C-N>\<Esc>0", 'tx!') + call assert_equal('one two one', getline('.')) + + call setline(1, ['你好 你']) + call feedkeys("A\<C-X>\<C-N>\<Esc>0", 'tx!') + call assert_equal('你好 你好', getline('.')) + call setline(1, ['你的 我的 的']) + call feedkeys("A\<C-X>\<C-N>\<Esc>0", 'tx!') + call assert_equal('你的 我的 你的', getline('.')) + " can fuzzy get multiple-byte word when use Ctrl-N twice + call setline(1, ['你的 我的 的']) + call feedkeys("A\<C-X>\<C-N>\<C-N>\<Esc>0", 'tx!') + call assert_equal('你的 我的 我的', getline('.')) + + "respect noinsert + set completeopt=fuzzycollect,menu,menuone,noinsert + call setline(1, ['one two o']) + call feedkeys("A\<C-X>\<C-N>", 'tx') + call assert_equal('one', g:word) + call assert_equal('one two o', getline('.')) + " clean up set omnifunc= bw! |