mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #10757 from bfredl/compfix
compositor: handle invalid screen positions after resize gracefully
This commit is contained in:
commit
0c952c1c8b
@ -4375,7 +4375,7 @@ static void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int endcol,
|
||||
screen_adjust_grid(&grid, &row, &coloff);
|
||||
|
||||
// Safety check. Avoids clang warnings down the call stack.
|
||||
if (grid->chars == NULL || row >= grid->Rows || col >= grid->Columns) {
|
||||
if (grid->chars == NULL || row >= grid->Rows || coloff >= grid->Columns) {
|
||||
DLOG("invalid state, skipped");
|
||||
return;
|
||||
}
|
||||
|
@ -480,8 +480,26 @@ static void ui_comp_raw_line(UI *ui, Integer grid, Integer row,
|
||||
if (curgrid != &default_grid) {
|
||||
flags = flags & ~kLineFlagWrap;
|
||||
}
|
||||
assert(row < default_grid.Rows);
|
||||
assert(clearcol <= default_grid.Columns);
|
||||
|
||||
assert(endcol <= clearcol);
|
||||
|
||||
// TODO(bfredl): this should not really be necessary. But on some condition
|
||||
// when resizing nvim, a window will be attempted to be drawn on the older
|
||||
// and possibly larger global screen size.
|
||||
if (row >= default_grid.Rows) {
|
||||
DLOG("compositor: invalid row %"PRId64" on grid %"PRId64, row, grid);
|
||||
return;
|
||||
}
|
||||
if (clearcol > default_grid.Columns) {
|
||||
DLOG("compositor: invalid last column %"PRId64" on grid %"PRId64,
|
||||
clearcol, grid);
|
||||
if (startcol >= default_grid.Columns) {
|
||||
return;
|
||||
}
|
||||
clearcol = default_grid.Columns;
|
||||
endcol = MIN(endcol, clearcol);
|
||||
}
|
||||
|
||||
if (flags & kLineFlagInvalid
|
||||
|| kv_size(layers) > curgrid->comp_index+1
|
||||
|| curgrid->blending) {
|
||||
|
Loading…
Reference in New Issue
Block a user