Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
30260:742a12140d60 | 30261:6b658ef69e93 |
---|---|
1402 int no_si = FALSE; // reset did_si afterwards | 1402 int no_si = FALSE; // reset did_si afterwards |
1403 int first_char = NUL; // init for GCC | 1403 int first_char = NUL; // init for GCC |
1404 int vreplace_mode; | 1404 int vreplace_mode; |
1405 int did_append; // appended a new line | 1405 int did_append; // appended a new line |
1406 int saved_pi = curbuf->b_p_pi; // copy of preserveindent setting | 1406 int saved_pi = curbuf->b_p_pi; // copy of preserveindent setting |
1407 #ifdef FEAT_PROP_POPUP | |
1408 int at_eol; // cursor after last character | |
1409 #endif | |
1407 | 1410 |
1408 // make a copy of the current line so we can mess with it | 1411 // make a copy of the current line so we can mess with it |
1409 saved_line = vim_strsave(ml_get_curline()); | 1412 saved_line = vim_strsave(ml_get_curline()); |
1410 if (saved_line == NULL) // out of memory! | 1413 if (saved_line == NULL) // out of memory! |
1411 return FALSE; | 1414 return FALSE; |
1415 | |
1416 #ifdef FEAT_PROP_POPUP | |
1417 at_eol = curwin->w_cursor.col >= (int)STRLEN(saved_line); | |
1418 #endif | |
1412 | 1419 |
1413 if (State & VREPLACE_FLAG) | 1420 if (State & VREPLACE_FLAG) |
1414 { | 1421 { |
1415 // With MODE_VREPLACE we make a copy of the next line, which we will be | 1422 // With MODE_VREPLACE we make a copy of the next line, which we will be |
1416 // starting to replace. First make the new line empty and let vim play | 1423 // starting to replace. First make the new line empty and let vim play |
2131 did_append = TRUE; | 2138 did_append = TRUE; |
2132 #ifdef FEAT_PROP_POPUP | 2139 #ifdef FEAT_PROP_POPUP |
2133 if ((State & MODE_INSERT) && (State & VREPLACE_FLAG) == 0) | 2140 if ((State & MODE_INSERT) && (State & VREPLACE_FLAG) == 0) |
2134 // Properties after the split move to the next line. | 2141 // Properties after the split move to the next line. |
2135 adjust_props_for_split(curwin->w_cursor.lnum, curwin->w_cursor.lnum, | 2142 adjust_props_for_split(curwin->w_cursor.lnum, curwin->w_cursor.lnum, |
2136 curwin->w_cursor.col + 1, 0); | 2143 curwin->w_cursor.col + 1, 0, at_eol); |
2137 #endif | 2144 #endif |
2138 } | 2145 } |
2139 else | 2146 else |
2140 { | 2147 { |
2141 // In MODE_VREPLACE state we are starting to replace the next line. | 2148 // In MODE_VREPLACE state we are starting to replace the next line. |