mirror of
https://github.com/neovim/neovim.git
synced 2025-09-21 02:38:19 +00:00
multigrid: Fix sending window grid handle in ext_newline mode
This commit is contained in:

committed by
Björn Linse

parent
16c3337122
commit
62be9f39ef
@@ -1579,8 +1579,6 @@ static void win_update(win_T *wp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wp->w_grid.was_resized = false;
|
|
||||||
|
|
||||||
/* restore got_int, unless CTRL-C was hit while redrawing */
|
/* restore got_int, unless CTRL-C was hit while redrawing */
|
||||||
if (!got_int)
|
if (!got_int)
|
||||||
got_int = save_got_int;
|
got_int = save_got_int;
|
||||||
@@ -5976,6 +5974,7 @@ void win_grid_alloc(win_T *wp, int doclear)
|
|||||||
ScreenGrid *grid = &wp->w_grid;
|
ScreenGrid *grid = &wp->w_grid;
|
||||||
int rows = grid->internal_rows;
|
int rows = grid->internal_rows;
|
||||||
int columns = grid->internal_columns;
|
int columns = grid->internal_columns;
|
||||||
|
int was_resized = false;
|
||||||
|
|
||||||
if (rows == 0) {
|
if (rows == 0) {
|
||||||
rows = wp->w_height;
|
rows = wp->w_height;
|
||||||
@@ -6002,7 +6001,7 @@ void win_grid_alloc(win_T *wp, int doclear)
|
|||||||
grid->Rows = rows;
|
grid->Rows = rows;
|
||||||
grid->Columns = columns;
|
grid->Columns = columns;
|
||||||
}
|
}
|
||||||
grid->was_resized = true;
|
was_resized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
grid->OffsetRow = wp->w_winrow;
|
grid->OffsetRow = wp->w_winrow;
|
||||||
@@ -6012,8 +6011,7 @@ void win_grid_alloc(win_T *wp, int doclear)
|
|||||||
// - a grid was just resized
|
// - a grid was just resized
|
||||||
// - screen_resize was called and all grid sizes must be sent
|
// - screen_resize was called and all grid sizes must be sent
|
||||||
// - the UI wants multigrid event (necessary)
|
// - the UI wants multigrid event (necessary)
|
||||||
if ((send_grid_resize || grid->was_resized)
|
if ((send_grid_resize || was_resized) && ui_is_external(kUIMultigrid)) {
|
||||||
&& ui_is_external(kUIMultigrid)) {
|
|
||||||
ui_call_grid_resize(grid->handle, grid->Columns, grid->Rows);
|
ui_call_grid_resize(grid->handle, grid->Columns, grid->Rows);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -347,15 +347,17 @@ void ui_cursor_goto(int new_row, int new_col)
|
|||||||
|
|
||||||
void ui_grid_cursor_goto(ScreenGrid *grid, int new_row, int new_col)
|
void ui_grid_cursor_goto(ScreenGrid *grid, int new_row, int new_col)
|
||||||
{
|
{
|
||||||
int off_row = (ui_is_external(kUIMultigrid) ? 0 : grid->OffsetRow);
|
new_row += ui_is_external(kUIMultigrid) ? 0 : grid->OffsetRow;
|
||||||
int off_col = (ui_is_external(kUIMultigrid) ? 0 : grid->OffsetColumn);
|
new_col += ui_is_external(kUIMultigrid) ? 0 : grid->OffsetColumn;
|
||||||
|
int handle = ui_is_external(kUIMultigrid) ? grid->handle : DEFAULT_GRID_HANDLE;
|
||||||
|
|
||||||
if (new_row + off_row == row && new_col + off_col == col) {
|
if (new_row == row && new_col == col && handle == cursor_grid_handle) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
row = new_row + off_row;
|
|
||||||
col = new_col + off_col;
|
row = new_row;
|
||||||
cursor_grid_handle = grid->handle;
|
col = new_col;
|
||||||
|
cursor_grid_handle = handle;
|
||||||
pending_cursor_update = true;
|
pending_cursor_update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user