mirror of
https://github.com/neovim/neovim.git
synced 2026-09-19 04:04:48 +00:00
fix(highlight): refresh highlight attrs before message output #25737
Problem: When MsgArea highlight is changed, the next message may flash and disappear because msg_start() renders with stale highlight attributes. msg_puts_len() uses HL_ATTR(HLF_MSG) to render message text, which happens before update_screen() calls highlight_changed(). So the message is rendered with outdated attrs. Solution: Call highlight_changed() in msg_start().
This commit is contained in:
@@ -2670,4 +2670,18 @@ describe('fg/bg special colors', function()
|
||||
eq(new_guifg, eval('synIDattr(hlID("Visual"), "bg#")'))
|
||||
eq(new_guibg, eval('synIDattr(hlID("Visual"), "sp#")'))
|
||||
end)
|
||||
|
||||
it('changed highlight is reflected in messages before redraw #17832', function()
|
||||
local screen = Screen.new(50, 7, { rgb = true })
|
||||
command('set termguicolors')
|
||||
-- :echomsg in the same request, before the next redraw.
|
||||
command('call nvim_set_hl(0, "MsgArea", {"fg": "Red"}) | echomsg "foo"')
|
||||
screen:expect({
|
||||
grid = [[
|
||||
^ |
|
||||
{1:~ }|*5
|
||||
{19:foo }|
|
||||
]],
|
||||
})
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user