diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-27 19:11:46 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-08-27 19:11:46 +0200 |
commit | e3daa06be1a3ba7ced0735582467d092275e591c (patch) | |
tree | 5e2baf4fbab8b88074e24cb6c9b580291aba1336 /src/charset.c | |
parent | b49ad28d731551ddbd5cc57f9c77d0df085ae845 (diff) |
patch 9.0.1802: Multiline regex with Visual selection fails with virtual textv9.0.1802
Problem: Multiline regex with Visual selection fails when Visual
selection contains virtual text after last char.
Solution: Only include virtual text after last char when getting full
line length.
closes: #12908
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'src/charset.c')
-rw-r--r-- | src/charset.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/charset.c b/src/charset.c index 7901479d43..1c7f7d7913 100644 --- a/src/charset.c +++ b/src/charset.c @@ -809,7 +809,7 @@ win_linetabsize_cts(chartabsize_T *cts, colnr_T len) cts->cts_vcol += win_lbr_chartabsize(cts, NULL); #ifdef FEAT_PROP_POPUP // check for a virtual text at the end of a line or on an empty line - if (cts->cts_has_prop_with_text && *cts->cts_ptr == NUL) + if (len == MAXCOL && cts->cts_has_prop_with_text && *cts->cts_ptr == NUL) { (void)win_lbr_chartabsize(cts, NULL); cts->cts_vcol += cts->cts_cur_text_width; @@ -1196,8 +1196,7 @@ win_lbr_chartabsize( || (tp->tp_col == MAXCOL && ((tp->tp_flags & TP_FLAG_ALIGN_ABOVE) ? col == 0 - : s[0] == NUL - && cts->cts_with_trailing))) + : s[0] == NUL && cts->cts_with_trailing))) && -tp->tp_id - 1 < gap->ga_len) { char_u *p = ((char_u **)gap->ga_data)[-tp->tp_id - 1]; |