diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-04-26 13:11:33 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-02 13:11:46 +0200 |
commit | a43b28a34c568eb3e280e75a81424f80f0ed980b (patch) | |
tree | c154890e31947200ae696773b184016178d35b14 /src/nvim/grid.c | |
parent | d6050e9bda7f8b080c577100ae94e017dc146c88 (diff) | |
download | rneovim-a43b28a34c568eb3e280e75a81424f80f0ed980b.tar.gz rneovim-a43b28a34c568eb3e280e75a81424f80f0ed980b.tar.bz2 rneovim-a43b28a34c568eb3e280e75a81424f80f0ed980b.zip |
vim-patch:9.0.0649: no indication the first line is broken for 'smoothscroll'
Problem: No indication when the first line is broken for 'smoothscroll'.
Solution: Show "<<<" in the first line.
https://github.com/vim/vim/commit/406b5d89e18742ac6e6256ffc72fb70a27f0148b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/grid.c')
-rw-r--r-- | src/nvim/grid.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/grid.c b/src/nvim/grid.c index 7745daf69a..2c548e11f1 100644 --- a/src/nvim/grid.c +++ b/src/nvim/grid.c @@ -503,6 +503,7 @@ void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int endcol, int cle int col = 0; bool redraw_next; // redraw_this for next character bool clear_next = false; + bool topline = row == 0; int char_cells; // 1: normal char // 2: occupies two display cells int start_dirty = -1, end_dirty = 0; @@ -529,6 +530,14 @@ void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int endcol, int cle max_off_from = linebuf_size; max_off_to = grid->line_offset[row] + (size_t)grid->cols; + if (topline && wp->w_skipcol > 0) { + // Take care of putting "<<<" on the first line for 'smoothscroll'. + for (int i = 0; i < 3; i++) { + schar_from_ascii(linebuf_char[i], '<'); + linebuf_attr[i] = HL_ATTR(HLF_AT); + } + } + if (rlflag) { // Clear rest first, because it's left of the text. if (clear_width > 0) { |