diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-09-22 11:09:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-22 11:09:33 +0200 |
commit | 7fc5f6605fb3de361c970a1d22a42a905a072a0c (patch) | |
tree | ffe2148ab3193f2c122ed43e9655e3179b17c1e5 /src/nvim/grid.c | |
parent | 8d13b08a03c31cdb269b7d09c166e0b447f2a303 (diff) | |
parent | 02f8ca59a80cd3570593c717ff6ceadc33239b89 (diff) | |
download | rneovim-7fc5f6605fb3de361c970a1d22a42a905a072a0c.tar.gz rneovim-7fc5f6605fb3de361c970a1d22a42a905a072a0c.tar.bz2 rneovim-7fc5f6605fb3de361c970a1d22a42a905a072a0c.zip |
Merge pull request #20249 from bfredl/cmdmessage
fix(redraw): avoid unnecessary redraws and glitches with floats+messages
Diffstat (limited to 'src/nvim/grid.c')
-rw-r--r-- | src/nvim/grid.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/grid.c b/src/nvim/grid.c index 63bb945f73..2b73ff895d 100644 --- a/src/nvim/grid.c +++ b/src/nvim/grid.c @@ -175,7 +175,7 @@ void grid_put_schar(ScreenGrid *grid, int row, int col, char *schar, int attr) { assert(put_dirty_row == row); size_t off = grid->line_offset[row] + (size_t)col; - if (grid->attrs[off] != attr || schar_cmp(grid->chars[off], schar)) { + if (grid->attrs[off] != attr || schar_cmp(grid->chars[off], schar) || rdb_flags & RDB_NODELTA) { schar_copy(grid->chars[off], schar); grid->attrs[off] = attr; @@ -280,7 +280,8 @@ void grid_puts_len(ScreenGrid *grid, char *text, int textlen, int row, int col, need_redraw = schar_cmp(grid->chars[off], buf) || (mbyte_cells == 2 && grid->chars[off + 1][0] != 0) || grid->attrs[off] != attr - || exmode_active; + || exmode_active + || rdb_flags & RDB_NODELTA; if (need_redraw) { // When at the end of the text and overwriting a two-cell @@ -412,8 +413,7 @@ void grid_fill(ScreenGrid *grid, int start_row, int end_row, int start_col, int size_t lineoff = grid->line_offset[row]; for (col = start_col; col < end_col; col++) { size_t off = lineoff + (size_t)col; - if (schar_cmp(grid->chars[off], sc) - || grid->attrs[off] != attr) { + if (schar_cmp(grid->chars[off], sc) || grid->attrs[off] != attr || rdb_flags & RDB_NODELTA) { schar_copy(grid->chars[off], sc); grid->attrs[off] = attr; if (dirty_first == INT_MAX) { @@ -605,7 +605,8 @@ void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int endcol, int cle while (col < clear_width) { if (grid->chars[off_to][0] != ' ' || grid->chars[off_to][1] != NUL - || grid->attrs[off_to] != bg_attr) { + || grid->attrs[off_to] != bg_attr + || rdb_flags & RDB_NODELTA) { grid->chars[off_to][0] = ' '; grid->chars[off_to][1] = NUL; grid->attrs[off_to] = bg_attr; |