From 801faeaae263b545afc18b1cb6f2ad14dceb4c23 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 23 Jun 2022 06:04:03 +0800 Subject: fix(input): use correct grid when restoring cursor for mapping (#19047) --- test/functional/ex_cmds/map_spec.lua | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/functional/ex_cmds/map_spec.lua b/test/functional/ex_cmds/map_spec.lua index eae36b9ae9..c6bdd017bd 100644 --- a/test/functional/ex_cmds/map_spec.lua +++ b/test/functional/ex_cmds/map_spec.lua @@ -86,7 +86,7 @@ n asdf1 qwert end) end) -describe(':*map cursor and redrawing', function() +describe('Screen', function() local screen before_each(function() clear() @@ -149,6 +149,18 @@ describe(':*map cursor and redrawing', function() ]]) end) + it('cursor position does not move after empty-string :cmap #19046', function() + command([[cnoremap '']]) + feed(':') + screen:expect([[ + | + ~ | + ~ | + ~ | + :^ | + ]]) + end) + it('cursor is restored after :map which redraws statusline vim-patch:8.1.2336', function() exec([[ call setline(1, ['one', 'two', 'three']) @@ -157,12 +169,12 @@ describe(':*map cursor and redrawing', function() hi! link StatusLine ErrorMsg noremap Func() func Func() - let g:on = !get(g:, 'on', 0) - redraws - return '' + let g:on = !get(g:, 'on', 0) + redraws + return '' endfunc func Status() - return get(g:, 'on', 0) ? '[on]' : '' + return get(g:, 'on', 0) ? '[on]' : '' endfunc set stl=%{Status()} ]]) -- cgit