diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-07-26 10:01:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-26 02:01:12 +0000 |
commit | 0dfcf3fe12ace3116bdffbbfc6875c67023eb8f2 (patch) | |
tree | 9e7098f0f7ff8c1b4feac3c093f858ca4f343c46 /src | |
parent | 5af9c065ada5600a076e24ca899da38b299c81e6 (diff) | |
download | rneovim-0dfcf3fe12ace3116bdffbbfc6875c67023eb8f2.tar.gz rneovim-0dfcf3fe12ace3116bdffbbfc6875c67023eb8f2.tar.bz2 rneovim-0dfcf3fe12ace3116bdffbbfc6875c67023eb8f2.zip |
fix(plines): don't count invalidated virt text in char size (#29863)
Also:
- Remove mt_end() and MT_FLAG_DECOR_VIRT_TEXT_INLINE checks, as they are
already checked by marktree_itr_check_filter().
- Move ns_in_win() to the last check in decor_redraw_col().
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/decoration.c | 9 | ||||
-rw-r--r-- | src/nvim/plines.c | 3 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c index 97801b3567..9c4a65b856 100644 --- a/src/nvim/decoration.c +++ b/src/nvim/decoration.c @@ -595,11 +595,7 @@ int decor_redraw_col(win_T *wp, int col, int win_col, bool hidden, DecorState *s break; } - if (!ns_in_win(mark.ns, wp)) { - goto next_mark; - } - - if (mt_invalid(mark) || mt_end(mark) || !mt_decor_any(mark)) { + if (mt_invalid(mark) || mt_end(mark) || !mt_decor_any(mark) || !ns_in_win(mark.ns, wp)) { goto next_mark; } @@ -743,8 +739,7 @@ void decor_redraw_signs(win_T *wp, buf_T *buf, int row, SignTextAttrs sattrs[], if (mark.pos.row != row) { break; } - if (!mt_end(mark) && !mt_invalid(mark) && mt_decor_sign(mark) - && ns_in_win(mark.ns, wp)) { + if (!mt_invalid(mark) && !mt_end(mark) && mt_decor_sign(mark) && ns_in_win(mark.ns, wp)) { DecorSignHighlight *sh = decor_find_sign(mt_decor(mark)); num_text += (sh->text[0] != NUL); kv_push(signs, ((SignItem){ sh, mark.id })); diff --git a/src/nvim/plines.c b/src/nvim/plines.c index f74beff954..c546099f58 100644 --- a/src/nvim/plines.c +++ b/src/nvim/plines.c @@ -158,8 +158,7 @@ CharSize charsize_regular(CharsizeArg *csarg, char *const cur, colnr_T const vco if (mark.pos.row != csarg->virt_row || mark.pos.col > col) { break; } else if (mark.pos.col == col) { - if (!mt_end(mark) && (mark.flags & MT_FLAG_DECOR_VIRT_TEXT_INLINE) - && ns_in_win(mark.ns, wp)) { + if (!mt_invalid(mark) && ns_in_win(mark.ns, wp)) { DecorInline decor = mt_decor(mark); DecorVirtText *vt = decor.ext ? decor.data.ext.vt : NULL; while (vt) { |