mirror of
https://github.com/neovim/neovim.git
synced 2026-08-01 05:09:08 +00:00
fix(cmdline): avoid redraw loop after wrapped line #40240
Problem: A wrapped command line and screen width may be redrawn
repeatedly after calls to `redrawstatus` from lua.
Solution: redrawcmd() redraws the command line, but msg_clr_eos() may
invalidate cmdline_was_last_drawn during the redraw process.
Restore cmdline_was_last_drawn when redrawcmd() completes.
Co-authored-by: Sam Reynoso <sam@codeoutpost.com>
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
(cherry picked from commit 6be9459d35)
This commit is contained in:
committed by
github-actions[bot]
parent
dffacf5c9d
commit
5ff4e147d0
@@ -4069,7 +4069,7 @@ void redrawcmd(void)
|
||||
// Typing ':' at the more prompt may set skip_redraw. We don't want this
|
||||
// in cmdline mode.
|
||||
skip_redraw = false;
|
||||
|
||||
cmdline_was_last_drawn = true;
|
||||
redrawing_cmdline = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1061,6 +1061,27 @@ describe('cmdline redraw', function()
|
||||
1 substitution on 1 line |
|
||||
]])
|
||||
end)
|
||||
|
||||
it('no empty cmdline after empty echo #18274', function()
|
||||
feed(':foo')
|
||||
api.nvim_echo({ { '' } }, false, {})
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|*3
|
||||
:foo^ |
|
||||
]])
|
||||
feed(('o'):rep(screen._width - 4))
|
||||
-- No repeated cmdline redraws at screen width
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|
|
||||
{3: }|
|
||||
:fooooooooooooooooooooooo|
|
||||
^ |
|
||||
]])
|
||||
command('call timer_start(0, {-> 1})')
|
||||
screen:expect_unchanged()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('statusline is redrawn on entering cmdline', function()
|
||||
|
||||
Reference in New Issue
Block a user