diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-06-26 07:22:19 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-06-26 09:16:17 +0200 |
commit | 4bf05ba3997b8033ccfd76503cd1fe14a9557a0f (patch) | |
tree | fb9ac4b1b054421baf7de3d43911184d9edd3ded /test/functional/ui/screen.lua | |
parent | 10c983fabeae6f2cda93404f3aa4ee814baa43f3 (diff) | |
download | rneovim-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/screen.lua')
-rw-r--r-- | test/functional/ui/screen.lua | 8 |
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 |