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.lua53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index ce7c9596bb..cb9d978a0f 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -865,6 +865,59 @@ local function test_cmdline(linegrid)
},
})
end)
+
+ it('works with conditionals', function()
+ local s1 = [[
+ ^ |
+ {1:~ }|*3
+ |
+ ]]
+ screen:expect(s1)
+ feed(':if 1<CR>')
+ screen:expect({
+ grid = s1,
+ cmdline = {
+ {
+ content = { { '' } },
+ firstc = ':',
+ indent = 2,
+ pos = 0,
+ },
+ },
+ cmdline_block = { { { 'if 1' } } },
+ })
+ feed(':let x = 1<CR>')
+ screen:expect({
+ grid = s1,
+ cmdline = {
+ {
+ content = { { '' } },
+ firstc = ':',
+ indent = 2,
+ pos = 0,
+ },
+ },
+ cmdline_block = { { { 'if 1' } }, { { ' :let x = 1' } } },
+ })
+ feed(':endif')
+ screen:expect({
+ grid = s1,
+ cmdline = {
+ {
+ content = { { ':endif' } },
+ firstc = ':',
+ indent = 2,
+ pos = 6,
+ },
+ },
+ cmdline_block = { { { 'if 1' } }, { { ' :let x = 1' } } },
+ })
+ feed('<CR>')
+ screen:expect({
+ grid = s1,
+ cmdline = { { abort = false } },
+ })
+ end)
end
-- the representation of cmdline and cmdline_block contents changed with ext_linegrid