fix(statusline): redraw when VIsual_mode changes

(cherry picked from commit 397d861566)
This commit is contained in:
zeertzjq
2023-06-06 18:03:01 +08:00
committed by github-actions[bot]
parent 55373061ab
commit 7e7fc4885f
3 changed files with 61 additions and 4 deletions

View File

@@ -627,11 +627,19 @@ it('K_EVENT does not trigger a statusline redraw unnecessarily', function()
eq(1, eval('g:counter < 50'), 'g:counter=' .. eval('g:counter'))
end)
it('statusline is redrawn on recording state change #22683', function()
it('statusline is redrawn on various state changes', function()
clear()
local screen = Screen.new(40, 4)
screen:attach()
-- recording state change #22683
command('set ls=2 stl=%{repeat(reg_recording(),5)}')
screen:expect([[
^ |
~ |
|
|
]])
feed('qQ')
screen:expect([[
^ |
@@ -639,6 +647,50 @@ it('statusline is redrawn on recording state change #22683', function()
QQQQQ |
recording @Q |
]])
feed('q')
screen:expect([[
^ |
~ |
|
|
]])
-- Visual mode change #23932
command('set ls=2 stl=%{mode(1)}')
screen:expect([[
^ |
~ |
n |
|
]])
feed('v')
screen:expect([[
^ |
~ |
v |
-- VISUAL -- |
]])
feed('V')
screen:expect([[
^ |
~ |
V |
-- VISUAL LINE -- |
]])
feed('<C-V>')
screen:expect([[
^ |
~ |
^V |
-- VISUAL BLOCK -- |
]])
feed('<Esc>')
screen:expect([[
^ |
~ |
n |
|
]])
end)
it('ruler is redrawn in cmdline with redrawstatus #22804', function()