comparison src/charset.c @ 33021:2b47322be0d1 v9.0.1802

patch 9.0.1802: Multiline regex with Visual selection fails with virtual text Commit: https://github.com/vim/vim/commit/e3daa06be1a3ba7ced0735582467d092275e591c Author: zeertzjq <zeertzjq@outlook.com> Date: Sun Aug 27 19:11:46 2023 +0200 patch 9.0.1802: Multiline regex with Visual selection fails with virtual text 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>
author Christian Brabandt <cb@256bit.org>
date Sun, 27 Aug 2023 19:15:09 +0200
parents 7d0357f70cf8
children 0561bf3ba10c
comparison
equal deleted inserted replaced
33020:120da95ad043 33021:2b47322be0d1
807 for ( ; *cts->cts_ptr != NUL && (len == MAXCOL || cts->cts_ptr < cts->cts_line + len); 807 for ( ; *cts->cts_ptr != NUL && (len == MAXCOL || cts->cts_ptr < cts->cts_line + len);
808 MB_PTR_ADV(cts->cts_ptr)) 808 MB_PTR_ADV(cts->cts_ptr))
809 cts->cts_vcol += win_lbr_chartabsize(cts, NULL); 809 cts->cts_vcol += win_lbr_chartabsize(cts, NULL);
810 #ifdef FEAT_PROP_POPUP 810 #ifdef FEAT_PROP_POPUP
811 // check for a virtual text at the end of a line or on an empty line 811 // check for a virtual text at the end of a line or on an empty line
812 if (cts->cts_has_prop_with_text && *cts->cts_ptr == NUL) 812 if (len == MAXCOL && cts->cts_has_prop_with_text && *cts->cts_ptr == NUL)
813 { 813 {
814 (void)win_lbr_chartabsize(cts, NULL); 814 (void)win_lbr_chartabsize(cts, NULL);
815 cts->cts_vcol += cts->cts_cur_text_width; 815 cts->cts_vcol += cts->cts_cur_text_width;
816 // when properties are above or below the empty line must also be 816 // when properties are above or below the empty line must also be
817 // counted 817 // counted
1194 && ((tp->tp_col - 1 >= col 1194 && ((tp->tp_col - 1 >= col
1195 && tp->tp_col - 1 < col + charlen) 1195 && tp->tp_col - 1 < col + charlen)
1196 || (tp->tp_col == MAXCOL 1196 || (tp->tp_col == MAXCOL
1197 && ((tp->tp_flags & TP_FLAG_ALIGN_ABOVE) 1197 && ((tp->tp_flags & TP_FLAG_ALIGN_ABOVE)
1198 ? col == 0 1198 ? col == 0
1199 : s[0] == NUL 1199 : s[0] == NUL && cts->cts_with_trailing)))
1200 && cts->cts_with_trailing)))
1201 && -tp->tp_id - 1 < gap->ga_len) 1200 && -tp->tp_id - 1 < gap->ga_len)
1202 { 1201 {
1203 char_u *p = ((char_u **)gap->ga_data)[-tp->tp_id - 1]; 1202 char_u *p = ((char_u **)gap->ga_data)[-tp->tp_id - 1];
1204 1203
1205 if (p != NULL) 1204 if (p != NULL)