mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
ext_cmdline: Add function block support
This commit is contained in:
committed by
Björn Linse
parent
866dadaf75
commit
461ae69824
@@ -7,7 +7,7 @@ if helpers.pending_win32(pending) then return end
|
||||
describe('External command line completion', function()
|
||||
local screen
|
||||
local shown = false
|
||||
local firstc, prompt, content, pos, char, shift, level, current_hide_level
|
||||
local firstc, prompt, content, pos, char, shift, level, current_hide_level, in_function
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
@@ -24,6 +24,10 @@ describe('External command line completion', function()
|
||||
char, shift = unpack(data)
|
||||
elseif name == "cmdline_pos" then
|
||||
pos = data[1]
|
||||
elseif name == "cmdline_function_show" then
|
||||
in_function = true
|
||||
elseif name == "cmdline_function_hide" then
|
||||
in_function = false
|
||||
end
|
||||
end)
|
||||
end)
|
||||
@@ -158,6 +162,39 @@ describe('External command line completion', function()
|
||||
eq(1, current_hide_level)
|
||||
end)
|
||||
|
||||
feed(':function Foo()<cr>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
|
|
||||
]], nil, nil, function()
|
||||
eq(true, in_function)
|
||||
end)
|
||||
|
||||
feed('line1<cr>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
|
|
||||
]], nil, nil, function()
|
||||
eq(true, in_function)
|
||||
end)
|
||||
|
||||
feed('endfunction<cr>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
|
|
||||
]], nil, nil, function()
|
||||
eq(false, in_function)
|
||||
end)
|
||||
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user