diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-09-30 10:31:55 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-10-03 15:20:09 +0200 |
commit | a9a48d6b5f00241e16e7131c997f0117bc5e9047 (patch) | |
tree | 2d7149793427477bf9d6cec6fe4c43b60a41c92c /src/nvim/grid.c | |
parent | 08aea256c8330f482319b0579944a56707cc5bbe (diff) | |
download | rneovim-a9a48d6b5f00241e16e7131c997f0117bc5e9047.tar.gz rneovim-a9a48d6b5f00241e16e7131c997f0117bc5e9047.tar.bz2 rneovim-a9a48d6b5f00241e16e7131c997f0117bc5e9047.zip |
refactor(message): simplify msg_puts_display and use batched grid updates
msg_puts_display was more complex than necessary in nvim, as in
nvim, it no longer talks directly with a terminal.
In particular we don't need to scroll the grid before emiting the last
char. The TUI already takes care of things like that, for terminals
where it matters.
Diffstat (limited to 'src/nvim/grid.c')
-rw-r--r-- | src/nvim/grid.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/grid.c b/src/nvim/grid.c index 712688368b..7a707407d2 100644 --- a/src/nvim/grid.c +++ b/src/nvim/grid.c @@ -455,6 +455,22 @@ void grid_line_flush(void) false, 0, false, invalid_row); } +/// flush grid line but only if on a valid row +/// +/// This is a stopgap until message.c has been refactored to behave +void grid_line_flush_if_valid_row(void) +{ + if (grid_line_row < 0 || grid_line_row >= grid_line_grid->rows) { + if (rdb_flags & RDB_INVALID) { + abort(); + } else { + grid_line_grid = NULL; + return; + } + } + grid_line_flush(); +} + /// Fill the grid from "start_row" to "end_row" (exclusive), from "start_col" /// to "end_col" (exclusive) with character "c1" in first column followed by /// "c2" in the other columns. Use attributes "attr". |