Mercurial > vim
diff src/change.c @ 16662:1fc9cd08cf3c v8.1.1333
patch 8.1.1333: text properties don't always move after changes
commit https://github.com/vim/vim/commit/45dd07f10af9bea86f8df77e92788209e209fdab
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed May 15 22:45:37 2019 +0200
patch 8.1.1333: text properties don't always move after changes
Problem: Text properties don't always move after changes.
Solution: Update properties before reporting changes to listeners. Move text
property when splitting a line.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 15 May 2019 23:00:15 +0200 |
parents | 04c2614af21c |
children | 978bcd70883d |
line wrap: on
line diff
--- a/src/change.c +++ b/src/change.c @@ -641,12 +641,12 @@ changed_bytes(linenr_T lnum, colnr_T col void inserted_bytes(linenr_T lnum, colnr_T col, int added UNUSED) { - changed_bytes(lnum, col); - #ifdef FEAT_TEXT_PROP if (curbuf->b_has_textprop && added != 0) adjust_prop_columns(lnum, col, added); #endif + + changed_bytes(lnum, col); } /* @@ -2133,6 +2133,12 @@ open_line( ) mark_adjust(curwin->w_cursor.lnum + 1, (linenr_T)MAXLNUM, 1L, 0L); did_append = TRUE; +#ifdef FEAT_TEXT_PROP + if ((State & INSERT) && !(State & VREPLACE_FLAG)) + // 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); +#endif } else {