cmdline: remove invalid cmdline_show event when aborting mapping

This commit is contained in:
Björn Linse
2019-06-26 07:22:19 +02:00
parent 10c983fabe
commit 4bf05ba399
3 changed files with 43 additions and 5 deletions

View File

@@ -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