From fbac2545110bec653a0cc984b04e3636593ec214 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 16 Sep 2024 09:10:51 +0800 Subject: vim-patch:9.1.0733: keyword completion does not work with fuzzy Problem: keyword completion does not work with fuzzy (egesip) Solution: handle ctrl_x_mode_normal() specifically (glepnir) fixes: vim/vim#15412 closes: vim/vim#15424 https://github.com/vim/vim/commit/7cfe693f9bfa74690867e4d96c25f2205d0d13e4 Co-authored-by: glepnir --- test/old/testdir/test_ins_complete.vim | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim index 3accb1f286..97a02adf0d 100644 --- a/test/old/testdir/test_ins_complete.vim +++ b/test/old/testdir/test_ins_complete.vim @@ -2900,10 +2900,38 @@ func Test_complete_fuzzy_match() call feedkeys("Su\\\\0", 'tx!') call assert_equal('no one can save me but you', getline('.')) + " issue #15412 + call setline(1, ['alpha bravio charlie']) + call feedkeys("Salpha\\\0", 'tx!') + call assert_equal('alpha bravio', getline('.')) + call feedkeys("Salp\\\0", 'tx!') + call assert_equal('alpha', getline('.')) + call feedkeys("A\\\0", 'tx!') + call assert_equal('alpha bravio', getline('.')) + call feedkeys("A\\\0", 'tx!') + call assert_equal('alpha bravio charlie', getline('.')) + + set complete-=i + call feedkeys("Salp\\\0", 'tx!') + call assert_equal('alpha', getline('.')) + call feedkeys("A\\\0", 'tx!') + call assert_equal('alpha bravio', getline('.')) + call feedkeys("A\\\0", 'tx!') + call assert_equal('alpha bravio charlie', getline('.')) + + call setline(1, ['alpha bravio charlie', 'alpha another']) + call feedkeys("Salpha\\\\0", 'tx!') + call assert_equal('alpha another', getline('.')) + call setline(1, ['你好 我好', '你好 他好']) + call feedkeys("S你好\\\0", 'tx!') + call assert_equal('你好 我好', getline('.')) + call feedkeys("S你好\\\\0", 'tx!') + call assert_equal('你好 他好', getline('.')) + " issue #15526 set completeopt=fuzzy,menuone,menu,noselect call setline(1, ['Text', 'ToText', '']) - call cursor(2, 1) + call cursor(3, 1) call feedkeys("STe\\x\\0", 'tx!') call assert_equal('Tex', getline(line('.') - 1)) -- cgit