1
0
forked from aniani/vim

patch 9.0.0466: virtual text wrong after adding line break after line

Problem:    Virtual text wrong after adding line break after line.
Solution:   Pass an "eol" flag to where text properties are adjusted.
            (closes #11131)
This commit is contained in:
Bram Moolenaar
2022-09-14 22:13:59 +01:00
parent e697d48890
commit ebd0e8bb85
6 changed files with 60 additions and 12 deletions

View File

@@ -1404,12 +1404,19 @@ open_line(
int vreplace_mode;
int did_append; // appended a new line
int saved_pi = curbuf->b_p_pi; // copy of preserveindent setting
#ifdef FEAT_PROP_POPUP
int at_eol; // cursor after last character
#endif
// make a copy of the current line so we can mess with it
saved_line = vim_strsave(ml_get_curline());
if (saved_line == NULL) // out of memory!
return FALSE;
#ifdef FEAT_PROP_POPUP
at_eol = curwin->w_cursor.col >= (int)STRLEN(saved_line);
#endif
if (State & VREPLACE_FLAG)
{
// With MODE_VREPLACE we make a copy of the next line, which we will be
@@ -2133,7 +2140,7 @@ open_line(
if ((State & MODE_INSERT) && (State & VREPLACE_FLAG) == 0)
// Properties after the split move to the next line.
adjust_props_for_split(curwin->w_cursor.lnum, curwin->w_cursor.lnum,
curwin->w_cursor.col + 1, 0);
curwin->w_cursor.col + 1, 0, at_eol);
#endif
}
else