aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor/completion_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/editor/completion_spec.lua')
-rw-r--r--test/functional/editor/completion_spec.lua49
1 files changed, 48 insertions, 1 deletions
diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua
index 6cdac3c079..22857efe5b 100644
--- a/test/functional/editor/completion_spec.lua
+++ b/test/functional/editor/completion_spec.lua
@@ -935,6 +935,9 @@ describe('completion', function()
eq({'api'}, funcs.getcompletion('vim.ap', 'lua'))
eq({'tbl_filter'}, funcs.getcompletion('vim.tbl_fil', 'lua'))
eq({'vim'}, funcs.getcompletion('print(vi', 'lua'))
+ -- fuzzy completion is not supported, so the result should be the same
+ command('set wildoptions+=fuzzy')
+ eq({'vim'}, funcs.getcompletion('vi', 'lua'))
end)
end)
@@ -1029,7 +1032,8 @@ describe('completion', function()
]])
end)
- it('TextChangedP autocommand', function()
+ -- oldtest: Test_ChangedP()
+ it('TextChangedI and TextChangedP autocommands', function()
curbufmeths.set_lines(0, 1, false, { 'foo', 'bar', 'foobar'})
source([[
set complete=. completeopt=menuone
@@ -1128,6 +1132,49 @@ describe('completion', function()
call cursor(4, 1)
]])
+ -- v:event.size should be set with ext_popupmenu #20646
+ screen:set_option('ext_popupmenu', true)
+ feed('Sf<C-N>')
+ screen:expect({grid = [[
+ foo |
+ bar |
+ foobar |
+ f^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {3:-- Keyword completion (^N^P) }{5:Back at original} |
+ ]], popupmenu = {
+ anchor = { 1, 3, 0 },
+ items = { { "foo", "", "", "" }, { "foobar", "", "", "" } },
+ pos = -1
+ }})
+ eq({completed_item = {}, width = 0,
+ height = 2, size = 2,
+ col = 0, row = 4, scrollbar = false},
+ eval('g:event'))
+ feed('oob')
+ screen:expect({grid = [[
+ foo |
+ bar |
+ foobar |
+ foob^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {3:-- Keyword completion (^N^P) }{5:Back at original} |
+ ]], popupmenu = {
+ anchor = { 1, 3, 0 },
+ items = { { "foobar", "", "", "" } },
+ pos = -1
+ }})
+ eq({completed_item = {}, width = 0,
+ height = 1, size = 1,
+ col = 0, row = 4, scrollbar = false},
+ eval('g:event'))
+ feed('<Esc>')
+ screen:set_option('ext_popupmenu', false)
+
feed('Sf<C-N>')
screen:expect([[
foo |