aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-06-26 10:47:18 +0200
committerGitHub <noreply@github.com>2019-06-26 10:47:18 +0200
commit8b263c7a6868105adae69f001899c5837b302bef (patch)
tree6c042cffb967fdf690fe76f23a6ed0ad05077f58 /test/functional/ui/screen.lua
parent48b4ecc96d505a8e5885a8a3cf3a59dc75c250a9 (diff)
parent4bf05ba3997b8033ccfd76503cd1fe14a9557a0f (diff)
downloadrneovim-8b263c7a6868105adae69f001899c5837b302bef.tar.gz
rneovim-8b263c7a6868105adae69f001899c5837b302bef.tar.bz2
rneovim-8b263c7a6868105adae69f001899c5837b302bef.zip
Merge pull request #10344 from bfredl/extcmdredraw
cmdline: remove invalid cmdline_show event when aborting mapping
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r--test/functional/ui/screen.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 044e4cc39c..0367e85028 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -946,6 +946,14 @@ function Screen:_handle_cmdline_show(content, pos, firstc, prompt, indent, level
if firstc == '' then firstc = nil end
if prompt == '' then prompt = nil end
if indent == 0 then indent = nil end
+
+ -- check position is valid #10000
+ local len = 0
+ for _, chunk in ipairs(content) do
+ len = len + string.len(chunk[2])
+ end
+ assert(pos <= len)
+
self.cmdline[level] = {content=content, pos=pos, firstc=firstc,
prompt=prompt, indent=indent}
end