fix(extmarks): fix wrong virt_text position after wrapped TAB (#25168)

This commit is contained in:
zeertzjq
2023-09-15 14:54:42 +08:00
committed by GitHub
parent b52bd8a2de
commit b65cd7ff1a
2 changed files with 52 additions and 3 deletions

View File

@@ -3085,11 +3085,11 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
if (has_decor && (wp->w_p_rl ? (wlv.col < 0) : (wlv.col >= grid->cols))) {
// At the end of screen line: might need to peek for decorations just after
// this position.
if (wp->w_p_wrap) {
if (!has_fold && wp->w_p_wrap && wlv.n_extra == 0) {
// FIXME: virt_text_hide doesn't work for overlay virt_text at the next char
// as it's not easy to check if the next char is inside Visual selection.
decor_redraw_col(wp, (int)(ptr - line), -3, false, &decor_state);
} else {
} else if (has_fold || !wp->w_p_wrap) {
// Without wrapping, we might need to display right_align and win_col
// virt_text for the entire text line.
decor_redraw_col(wp, MAXCOL, -1, true, &decor_state);