diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-14 22:13:59 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-14 22:13:59 +0100 |
commit | ebd0e8bb853cb744b60bf4f57011c4379ae4aaed (patch) | |
tree | bda75c257efb71dacc825e7162b006eb72205d6a /src/change.c | |
parent | e697d488901b6321ddaad68b553f0a434c97d849 (diff) |
patch 9.0.0466: virtual text wrong after adding line break after linev9.0.0466
Problem: Virtual text wrong after adding line break after line.
Solution: Pass an "eol" flag to where text properties are adjusted.
(closes #11131)
Diffstat (limited to 'src/change.c')
-rw-r--r-- | src/change.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/change.c b/src/change.c index b84dfad358..038f3c199f 100644 --- a/src/change.c +++ b/src/change.c @@ -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 |