From 9f32deba56ea867a8bb9b9ab7f44bcc5142e8bbc Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 13 Oct 2023 21:43:06 +0800 Subject: fix(grid): add start column when getting char on line (#25627) --- test/functional/editor/mode_insert_spec.lua | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test') diff --git a/test/functional/editor/mode_insert_spec.lua b/test/functional/editor/mode_insert_spec.lua index 12f450520a..37651164f5 100644 --- a/test/functional/editor/mode_insert_spec.lua +++ b/test/functional/editor/mode_insert_spec.lua @@ -192,4 +192,38 @@ describe('insert-mode', function() feed('i') expect('') end) + + it('multi-char mapping updates screen properly #25626', function() + local screen = Screen.new(60, 6) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}; -- NonText + [1] = {bold = true, reverse = true}; -- StatusLine + [2] = {reverse = true}; -- StatusLineNC + [3] = {bold = true}; -- ModeMsg + }) + screen:attach() + command('vnew') + insert('foo\nfoo\nfoo') + command('wincmd w') + command('set timeoutlen=10000') + command('inoremap jk ') + feed('iβββj') + screen:expect{grid=[[ + foo │ | + foo │β^jβ | + foo │{0:~ }| + {0:~ }│{0:~ }| + {2:[No Name] [+] }{1:[No Name] [+] }| + {3:-- INSERT --} | + ]]} + feed('k') + screen:expect{grid=[[ + foo │ | + foo │^βββ | + foo │{0:~ }| + {0:~ }│{0:~ }| + {2:[No Name] [+] }{1:[No Name] [+] }| + | + ]]} + end) end) -- cgit