diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-09-01 18:49:30 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-09-01 18:49:30 +0200 |
commit | ce53e3ea55d12d222a73510d772e786b7ae29c8d (patch) | |
tree | ad4f205fc46fb69d364a198a1b7ab9bbb42175b2 /src/drawline.c | |
parent | 7a9d1aa878d8724e28893b968016b86a3a70c63f (diff) |
patch 9.0.1836: display wrong with virttext, linebreak and breakindentv9.0.1836
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>
Diffstat (limited to 'src/drawline.c')
-rw-r--r-- | src/drawline.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/drawline.c b/src/drawline.c index 63bc96c4da..edcf55cf3f 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -1650,6 +1650,18 @@ win_line( } #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 @@ win_line( 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; |