diff options
author | LemonBoy <thatlemon@gmail.com> | 2022-05-14 18:48:05 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-14 18:48:05 +0100 |
commit | 788c06a2492b546dd0824b119251cd8ea7da9cb5 (patch) | |
tree | 161c5fe7af8286ae9e7a28744ed66a567e33f6c8 /src/change.c | |
parent | 698cb4c8fa16a4dbe4830648532c09d7e5c89095 (diff) |
patch 8.2.4955: text property in wrong position after auto-indentv8.2.4955
Problem: Text property in wrong position after auto-indent.
Solution: Adjust text property columns. (closes #10422, closes #7719)
Diffstat (limited to 'src/change.c')
-rw-r--r-- | src/change.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/change.c b/src/change.c index b7618c5ba8..a9c3e19f4c 100644 --- a/src/change.c +++ b/src/change.c @@ -1372,7 +1372,8 @@ open_line( char_u *next_line = NULL; // copy of the next line char_u *p_extra = NULL; // what goes to next line int less_cols = 0; // less columns for mark in new line - int less_cols_off = 0; // columns to skip for mark adjust + int less_cols_off = 0; // columns to skip for mark and + // textprop adjustment pos_T old_cursor; // old cursor position int newcol = 0; // new cursor column int newindent = 0; // auto-indent of the new line @@ -2151,9 +2152,9 @@ open_line( did_append = TRUE; #ifdef FEAT_PROP_POPUP if ((State & MODE_INSERT) && (State & VREPLACE_FLAG) == 0) - // properties after the split move to the next line + // 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); #endif } else @@ -2248,6 +2249,12 @@ open_line( mark_col_adjust(curwin->w_cursor.lnum, curwin->w_cursor.col + less_cols_off, 1L, (long)-less_cols, 0); +#ifdef FEAT_PROP_POPUP + // Keep into account the deleted blanks on the new line. + if (curbuf->b_has_textprop && less_cols_off != 0) + adjust_prop_columns(curwin->w_cursor.lnum + 1, 0, + -less_cols_off, 0); +#endif } else changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col); |