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().
This commit is contained in:
zeertzjq
2024-07-26 10:01:12 +08:00
committed by GitHub
parent 5af9c065ad
commit 0dfcf3fe12
3 changed files with 65 additions and 9 deletions

View File

@@ -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 }));

View File

@@ -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) {