summaryrefslogtreecommitdiff
path: root/src/ops.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-17 22:57:26 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-17 22:57:26 +0200
commit8055d17388736421d875dd4933c4c93d49a2ab58 (patch)
tree81ebca77b3ed10b02f42f8513c29b838ac7952fb /src/ops.c
parent787880a86dbcb79cdf6e8241b1d99ac4a7acbc09 (diff)
downloadvim-git-8055d17388736421d875dd4933c4c93d49a2ab58.tar.gz
patch 8.1.1343: text properties not adjusted for Visual block mode deletev8.1.1343
Problem: Text properties not adjusted for Visual block mode delete. Solution: Call adjust_prop_columns(). (closes #4384)
Diffstat (limited to 'src/ops.c')
-rw-r--r--src/ops.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ops.c b/src/ops.c
index 489c47354..480516b30 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -1916,10 +1916,9 @@ op_delete(oparg_T *oap)
curwin->w_cursor.coladd = 0;
}
- /* n == number of chars deleted
- * If we delete a TAB, it may be replaced by several characters.
- * Thus the number of characters may increase!
- */
+ // "n" == number of chars deleted
+ // If we delete a TAB, it may be replaced by several characters.
+ // Thus the number of characters may increase!
n = bd.textlen - bd.startspaces - bd.endspaces;
oldp = ml_get(lnum);
newp = alloc_check((unsigned)STRLEN(oldp) + 1 - n);
@@ -1935,6 +1934,11 @@ op_delete(oparg_T *oap)
STRMOVE(newp + bd.textcol + bd.startspaces + bd.endspaces, oldp);
/* replace the line */
ml_replace(lnum, newp, FALSE);
+
+#ifdef FEAT_TEXT_PROP
+ if (curbuf->b_has_textprop && n != 0)
+ adjust_prop_columns(lnum, bd.textcol, -n);
+#endif
}
check_cursor_col();