summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/testdir/test_textprop.vim13
-rw-r--r--src/textprop.c4
-rw-r--r--src/version.c2
3 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 5bd7e95c3..dbf393f89 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -1132,6 +1132,19 @@ func Test_proptype_substitute2()
bwipe!
endfunc
+" This was causing property corruption.
+func Test_proptype_substitute3()
+ new
+ call setline(1, ['abcxxx', 'def'])
+ call prop_type_add("test", {"highlight": "Search"})
+ call prop_add(1, 2, {"end_lnum": 2, "end_col": 2, "type": "test"})
+ %s/x\+$//
+ redraw
+
+ call prop_type_delete('test')
+ bwipe!
+endfunc
+
func SaveOptions()
let d = #{tabstop: &tabstop,
\ softtabstop: &softtabstop,
diff --git a/src/textprop.c b/src/textprop.c
index 639c5df8a..bca0d9e02 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1349,6 +1349,10 @@ adjust_prop_columns(
&& u_savesub(lnum) == FAIL)
return FALSE;
dirty = TRUE;
+
+ // u_savesub() may have updated curbuf->b_ml, fetch it again
+ if (curbuf->b_ml.ml_line_lnum != lnum)
+ proplen = get_text_props(curbuf, lnum, &props, TRUE);
}
if (res.can_drop)
continue; // Drop this text property
diff --git a/src/version.c b/src/version.c
index a7def1b6c..7031d7a56 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1714,
+/**/
1713,
/**/
1712,