diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-11-27 16:22:19 +0100 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2023-11-28 16:44:20 +0000 |
commit | 35cec0de4acd351119230330f54b0a45f9823695 (patch) | |
tree | 037df46125ccb4cae871b66147918553671c5228 /src/nvim/decoration.c | |
parent | adb2258345409d08c42809da0212eeb792e70106 (diff) | |
download | rneovim-35cec0de4acd351119230330f54b0a45f9823695.tar.gz rneovim-35cec0de4acd351119230330f54b0a45f9823695.tar.bz2 rneovim-35cec0de4acd351119230330f54b0a45f9823695.zip |
fix(column): redraw and update signcols for paired extmark
Problem: Signcolumn width does not increase when ranged sign does not
start at sentinel line.
Solution: Handle paired range of added sign when checking signcols.
Diffstat (limited to 'src/nvim/decoration.c')
-rw-r--r-- | src/nvim/decoration.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c index 29993bffa5..c2bef5920c 100644 --- a/src/nvim/decoration.c +++ b/src/nvim/decoration.c @@ -169,7 +169,7 @@ DecorSignHighlight decor_sh_from_inline(DecorHighlightInline item) return conv; } -void buf_put_decor(buf_T *buf, DecorInline decor, int row) +void buf_put_decor(buf_T *buf, DecorInline decor, int row, int row2) { if (decor.ext) { DecorVirtText *vt = decor.data.ext.vt; @@ -181,7 +181,7 @@ void buf_put_decor(buf_T *buf, DecorInline decor, int row) uint32_t idx = decor.data.ext.sh_idx; while (idx != DECOR_ID_INVALID) { DecorSignHighlight *sh = &kv_A(decor_items, idx); - buf_put_decor_sh(buf, sh, row); + buf_put_decor_sh(buf, sh, row, row2); idx = sh->next; } } @@ -202,14 +202,14 @@ void buf_put_decor_virt(buf_T *buf, DecorVirtText *vt) } static int sign_add_id = 0; -void buf_put_decor_sh(buf_T *buf, DecorSignHighlight *sh, int row) +void buf_put_decor_sh(buf_T *buf, DecorSignHighlight *sh, int row, int row2) { if (sh->flags & kSHIsSign) { sh->sign_add_id = sign_add_id++; buf->b_signs++; if (sh->text.ptr) { buf->b_signs_with_text++; - buf_signcols_add_check(buf, row + 1); + buf_signcols_add_check(buf, row + 1, row2 + 1); } } } @@ -835,7 +835,7 @@ int decor_signcols(buf_T *buf, int row, int end_row, int max) } if (count > signcols) { - if (row != end_row) { + if (count > buf->b_signcols.size) { buf->b_signcols.sentinel = currow + 1; } if (count >= max) { |