diff options
author | Ibby <33922797+SleepySwords@users.noreply.github.com> | 2023-08-20 20:24:18 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-08-20 20:24:18 +0200 |
commit | a6ab5e69d3f14da8036a3018e8e93c635803ee8b (patch) | |
tree | 91c75c62f575cc7b66fdb65811a17e405fd97211 /src/charset.c | |
parent | f6fb52b667eecb58bdd9b26bd462d5da61697cf7 (diff) |
patch 9.0.1770: lines disappear when modifying chars before virt textv9.0.1770
Problem: lines disappear when modifying chars before virt text
Solution: take virtual text property length into account
closes: #12558
closes: #12244
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ibby <33922797+SleepySwords@users.noreply.github.com>
Diffstat (limited to 'src/charset.c')
-rw-r--r-- | src/charset.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/charset.c b/src/charset.c index 7ffd8d8a75..14373c1c3d 100644 --- a/src/charset.c +++ b/src/charset.c @@ -808,16 +808,14 @@ win_linetabsize_cts(chartabsize_T *cts, colnr_T len) MB_PTR_ADV(cts->cts_ptr)) cts->cts_vcol += win_lbr_chartabsize(cts, NULL); #ifdef FEAT_PROP_POPUP - // check for a virtual text on an empty line - if (cts->cts_has_prop_with_text && *cts->cts_ptr == NUL - && cts->cts_ptr == cts->cts_line) + // 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) { (void)win_lbr_chartabsize(cts, NULL); cts->cts_vcol += cts->cts_cur_text_width; - // when properties are above or below the empty line must also be // counted - if (cts->cts_prop_lines > 0) + if (cts->cts_ptr == cts->cts_line && cts->cts_prop_lines > 0) ++cts->cts_vcol; } #endif @@ -1190,7 +1188,7 @@ win_lbr_chartabsize( || (tp->tp_col == MAXCOL && ((tp->tp_flags & TP_FLAG_ALIGN_ABOVE) ? col == 0 - : (s[0] == NUL || s[charlen] == NUL) + : s[0] == NUL && cts->cts_with_trailing))) && -tp->tp_id - 1 < gap->ga_len) { |