summaryrefslogtreecommitdiffstats
path: root/src/change.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-15 22:45:37 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-15 22:45:37 +0200
commit45dd07f10af9bea86f8df77e92788209e209fdab (patch)
treef13ed8d114a89aaa99a9ff0ca9a85bde4a62a16c /src/change.c
parentfe1ade0a78a70a4c7ddaebb6964497f037f4997a (diff)
patch 8.1.1333: text properties don't always move after changesv8.1.1333
Problem: Text properties don't always move after changes. Solution: Update properties before reporting changes to listeners. Move text property when splitting a line.
Diffstat (limited to 'src/change.c')
-rw-r--r--src/change.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/change.c b/src/change.c
index 9b71596ec7..86f1ffcfb4 100644
--- 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
{