neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit e6ddceda318d699726d4a69abbefaf4c2b93794c
parent 2dc439c672facaeb8e51ef6aa20efc0e7092eee2
Author: Luuk van Baal <luukvbaal@gmail.com>
Date:   Wed,  3 Jan 2024 00:55:35 +0100

refactor(decorations): more conservative redraw range

Problem:  Decor range is being redrawn unconditionally, negating the
          more conservative line redrawing that follows.
Solution: Get rid of unconditional redraw_buf_range_later() call.

Diffstat:
Msrc/nvim/decoration.c | 13+++----------
1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c @@ -93,20 +93,13 @@ void bufhl_add_hl_pos_offset(buf_T *buf, int src_id, int hl_id, lpos_T pos_start void decor_redraw(buf_T *buf, int row1, int row2, DecorInline decor) { - if (row2 >= row1) { - redraw_buf_range_later(buf, row1 + 1, row2 + 1); - } - if (decor.ext) { DecorVirtText *vt = decor.data.ext.vt; while (vt) { - if (vt->flags & kVTIsLines) { - redraw_buf_line_later(buf, row1 + 1 + ((vt->flags & kVTLinesAbove) ? 0 : 1), true); + bool below = (vt->flags & kVTIsLines) && !(vt->flags & kVTLinesAbove); + redraw_buf_line_later(buf, row1 + 1 + below, true); + if (vt->flags & kVTIsLines || vt->pos == kVPosInline) { changed_line_display_buf(buf); - } else { - if (vt->pos == kVPosInline) { - changed_line_display_buf(buf); - } } vt = vt->next; }