summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_ins_complete.vim
diff options
context:
space:
mode:
authornwounkn <nwounkn@gmail.com>2023-10-17 11:05:38 +0200
committerChristian Brabandt <cb@256bit.org>2023-10-17 11:05:38 +0200
commit2e3cd52fa02b1a208c97992b1bca3b04f7be66d4 (patch)
tree0d1208be07ee65407868e05ce4465b999a560e73 /src/testdir/test_ins_complete.vim
parentf3eac695bfe3453fe2a8b980601c55835406f14b (diff)
patch 9.0.2039: completion shows current word after completion restartv9.0.2039
Problem: completion shows current word after completion restart Solution: remove the word being completed after completion restart The word being completed is shown in a completion list after completion restart, because it isn't removed from the current buffer before searching for matches. Also adjust `Test_complete_add_onechar` to match the new behavior. closes: #13349 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: nwounkn <nwounkn@gmail.com>
Diffstat (limited to 'src/testdir/test_ins_complete.vim')
-rw-r--r--src/testdir/test_ins_complete.vim13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim
index c7f9e9b28b..a4ac26e06c 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -818,7 +818,7 @@ func Test_complete_add_onechar()
setlocal complete=.
call setline(1, ['workhorse', 'workload'])
normal Go
- exe "normal aWOR\<C-P>\<bs>\<bs>\<bs>\<bs>\<bs>\<bs>\<C-L>r\<C-L>\<C-L>"
+ exe "normal aWOR\<C-P>\<bs>\<bs>\<bs>\<bs>\<bs>\<bs>\<C-L>\<C-L>\<C-L>"
call assert_equal('workh', getline(3))
set ignorecase& backspace&
close!
@@ -2248,6 +2248,17 @@ func GetCompleteInfo()
return ''
endfunc
+func Test_completion_restart()
+ new
+ set complete=. completeopt=menuone backspace=2
+ call setline(1, 'workhorse workhorse')
+ exe "normal $a\<C-N>\<BS>\<BS>\<C-R>=GetCompleteInfo()\<CR>"
+ call assert_equal(1, len(g:compl_info['items']))
+ call assert_equal('workhorse', g:compl_info['items'][0]['word'])
+ set complete& completeopt& backspace&
+ bwipe!
+endfunc
+
func Test_complete_info_index()
new
call setline(1, ["aaa", "bbb", "ccc", "ddd", "eee", "fff"])