summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_popup.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_popup.vim')
-rw-r--r--src/testdir/test_popup.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index a0a1f74..f5cb8b2 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -1139,6 +1139,10 @@ func Test_CompleteChanged()
let g:event = copy(v:event)
let g:item = get(v:event, 'completed_item', {})
let g:word = get(g:item, 'word', v:null)
+ let l:line = getline('.')
+ if g:word == v:null && l:line == "bc"
+ let g:word = l:line
+ endif
endfunction
augroup AAAAA_Group
au!
@@ -1158,10 +1162,24 @@ func Test_CompleteChanged()
call assert_equal(v:null, g:word)
call feedkeys("a\<C-N>\<C-N>\<C-N>\<C-N>\<C-P>", 'tx')
call assert_equal('foobar', g:word)
+ call feedkeys("S\<C-N>bc", 'tx')
+ call assert_equal("bc", g:word)
+
+ func Omni_test(findstart, base)
+ if a:findstart
+ return col(".")
+ endif
+ return [#{word: "one"}, #{word: "two"}, #{word: "five"}]
+ endfunc
+ set omnifunc=Omni_test
+ set completeopt=menu,menuone
+ call feedkeys("i\<C-X>\<C-O>\<BS>\<BS>\<BS>f", 'tx')
+ call assert_equal('five', g:word)
autocmd! AAAAA_Group
set complete& completeopt&
delfunc! OnPumChange
+ delfunc! Omni_test
bw!
endfunc