aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/cmdline_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-06-26 07:22:19 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2019-06-26 09:16:17 +0200
commit4bf05ba3997b8033ccfd76503cd1fe14a9557a0f (patch)
treefb9ac4b1b054421baf7de3d43911184d9edd3ded /test/functional/ui/cmdline_spec.lua
parent10c983fabeae6f2cda93404f3aa4ee814baa43f3 (diff)
downloadrneovim-4bf05ba3997b8033ccfd76503cd1fe14a9557a0f.tar.gz
rneovim-4bf05ba3997b8033ccfd76503cd1fe14a9557a0f.tar.bz2
rneovim-4bf05ba3997b8033ccfd76503cd1fe14a9557a0f.zip
cmdline: remove invalid cmdline_show event when aborting mapping
Diffstat (limited to 'test/functional/ui/cmdline_spec.lua')
-rw-r--r--test/functional/ui/cmdline_spec.lua39
1 files changed, 34 insertions, 5 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 915e7ae867..c63b726308 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -761,8 +761,42 @@ local function test_cmdline(linegrid)
}}, wildmenu_items=expected, wildmenu_pos=0}
end)
+ it("doesn't send invalid events when aborting mapping #10000", function()
+ command('cnoremap ab c')
+
+ feed(':xa')
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]], cmdline={{
+ content = { { "x" } },
+ firstc = ":",
+ pos = 1,
+ special = { "a", false }
+ }}}
+
+ -- This used to send an invalid event where pos where larger than the total
+ -- lenght of content. Checked in _handle_cmdline_show.
+ feed('<esc>')
+ screen:expect([[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]])
+ end)
+
end
+-- the representation of cmdline and cmdline_block contents changed with ext_linegrid
+-- (which uses indexed highlights) so make sure to test both
+describe('ui/ext_cmdline', function() test_cmdline(true) end)
+describe('ui/ext_cmdline (legacy highlights)', function() test_cmdline(false) end)
+
describe('cmdline redraw', function()
local screen
before_each(function()
@@ -813,8 +847,3 @@ describe('cmdline redraw', function()
]], unchanged=true}
end)
end)
-
--- the representation of cmdline and cmdline_block contents changed with ext_linegrid
--- (which uses indexed highlights) so make sure to test both
-describe('ui/ext_cmdline', function() test_cmdline(true) end)
-describe('ui/ext_cmdline (legacy highlights)', function() test_cmdline(false) end)