mirror of
https://github.com/neovim/neovim
synced 2025-07-17 17:51:48 +00:00
fix(grid): double grid_line_start() with ext_messages #31292
Problem: Hit double grid_line_start() assert when redrawing from ext_messages msg_ruler event. Solution: Do not start() batched grid calls when win_redr_ruler() will not puts() anything.
This commit is contained in:
@ -1092,10 +1092,14 @@ int showmode(void)
|
|||||||
win_T *ruler_win = curwin->w_status_height == 0 ? curwin : lastwin_nofloating();
|
win_T *ruler_win = curwin->w_status_height == 0 ? curwin : lastwin_nofloating();
|
||||||
if (redrawing() && ruler_win->w_status_height == 0 && global_stl_height() == 0
|
if (redrawing() && ruler_win->w_status_height == 0 && global_stl_height() == 0
|
||||||
&& !(p_ch == 0 && !ui_has(kUIMessages))) {
|
&& !(p_ch == 0 && !ui_has(kUIMessages))) {
|
||||||
|
if (!ui_has(kUIMessages)) {
|
||||||
grid_line_start(&msg_grid_adj, Rows - 1);
|
grid_line_start(&msg_grid_adj, Rows - 1);
|
||||||
|
}
|
||||||
win_redr_ruler(ruler_win);
|
win_redr_ruler(ruler_win);
|
||||||
|
if (!ui_has(kUIMessages)) {
|
||||||
grid_line_flush();
|
grid_line_flush();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
redraw_cmdline = false;
|
redraw_cmdline = false;
|
||||||
redraw_mode = false;
|
redraw_mode = false;
|
||||||
|
@ -1159,6 +1159,21 @@ stack traceback:
|
|||||||
exec_lua([[vim.print({ foo = "bar" })]])
|
exec_lua([[vim.print({ foo = "bar" })]])
|
||||||
screen:expect_unchanged()
|
screen:expect_unchanged()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('ruler redraw does not crash due to double grid_line_start()', function()
|
||||||
|
exec_lua([[
|
||||||
|
local ns = vim.api.nvim_create_namespace('')
|
||||||
|
vim.ui_attach(ns, { ext_messages = true }, function(event, ...)
|
||||||
|
if event == 'msg_ruler' then
|
||||||
|
vim.api.nvim__redraw({ flush = true })
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
vim.o.ruler = true
|
||||||
|
vim.o.laststatus = 0
|
||||||
|
]])
|
||||||
|
feed('i')
|
||||||
|
n.assert_alive()
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('ui/builtin messages', function()
|
describe('ui/builtin messages', function()
|
||||||
|
Reference in New Issue
Block a user