mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
screen: initialize screen properly with early set display-=msgsep
Currently `nvim -u NORC --cmd "set display-=msgsep"` will still allocate the message grid and remove it just afterwards. While inefficient, we must make sure update_screen() re-validates the default_grid completely when this happens. Fix some invalid logic: don't reallocate msg_grid on resize when the grid is not used. Elide a too early ui_flush() on startup, which caused an invalid cursor position to be used.
This commit is contained in:
@@ -154,8 +154,8 @@ void msg_grid_validate(void)
|
||||
{
|
||||
grid_assign_handle(&msg_grid);
|
||||
bool should_alloc = msg_dothrottle();
|
||||
if (msg_grid.Rows != Rows || msg_grid.Columns != Columns
|
||||
|| (should_alloc && !msg_grid.chars)) {
|
||||
if (should_alloc && (msg_grid.Rows != Rows || msg_grid.Columns != Columns
|
||||
|| !msg_grid.chars)) {
|
||||
// TODO(bfredl): eventually should be set to "invalid". I e all callers
|
||||
// will use the grid including clear to EOS if necessary.
|
||||
grid_alloc(&msg_grid, Rows, Columns, false, true);
|
||||
|
Reference in New Issue
Block a user