Mercurial > vim
diff src/change.c @ 30261:6b658ef69e93 v9.0.0466
patch 9.0.0466: virtual text wrong after adding line break after line
Commit: https://github.com/vim/vim/commit/ebd0e8bb853cb744b60bf4f57011c4379ae4aaed
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 14 22:13:59 2022 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 14 Sep 2022 23:15:03 +0200 |
parents | 711ae604980a |
children | 9a6f7e750697 |
line wrap: on
line diff
--- 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