patch 9.0.1836: display wrong with virttext, linebreak and breakindent
Problem: Wrong display with "above" virtual text and 'linebreak' or
'breakindent' and 'showbreak'.
Solution: Exclude size of "above" virtual text when calculating them.
closes: #13000
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
diff --git a/src/drawline.c b/src/drawline.c
index 63bc96c..edcf55c 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -1650,6 +1650,18 @@
}
#endif
+#if defined(FEAT_LINEBREAK) || defined(FEAT_PROP_POPUP)
+ colnr_T vcol_first_char = 0;
+ if (wp->w_p_lbr && !number_only)
+ {
+ chartabsize_T cts;
+ init_chartabsize_arg(&cts, wp, lnum, 0, line, line);
+ (void)win_lbr_chartabsize(&cts, NULL);
+ vcol_first_char = cts.cts_first_char;
+ clear_chartabsize_arg(&cts);
+ }
+#endif
+
// 'nowrap' or 'wrap' and a single line that doesn't fit: Advance to the
// first character to be displayed.
if (wp->w_p_wrap)
@@ -2879,7 +2891,11 @@
char_u *p = ptr - (mb_off + 1);
chartabsize_T cts;
- init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, p);
+ init_chartabsize_arg(&cts, wp, lnum, wlv.vcol
+# ifdef FEAT_PROP_POPUP
+ - vcol_first_char,
+# endif
+ line, p);
# ifdef FEAT_PROP_POPUP
// do not want virtual text counted here
cts.cts_has_prop_with_text = FALSE;