aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/cmdline_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui/cmdline_spec.lua')
-rw-r--r--test/functional/ui/cmdline_spec.lua39
1 files changed, 38 insertions, 1 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 479d40e959..9e2857bc95 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -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)