patch 8.1.1343: text properties not adjusted for Visual block mode delete
Problem: Text properties not adjusted for Visual block mode delete.
Solution: Call adjust_prop_columns(). (closes #4384)
diff --git a/src/misc1.c b/src/misc1.c
index 5dcf268..f83e807 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -434,8 +434,15 @@
saved_cursor.col = (colnr_T)(s - newline);
}
#ifdef FEAT_TEXT_PROP
- adjust_prop_columns(curwin->w_cursor.lnum, (colnr_T)(p - oldline),
- ind_len - (colnr_T)(p - oldline));
+ {
+ int added = ind_len - (colnr_T)(p - oldline);
+
+ // When increasing indent this behaves like spaces were inserted at
+ // the old indent, when decreasing indent it behaves like spaces
+ // were deleted at the new indent.
+ adjust_prop_columns(curwin->w_cursor.lnum,
+ (colnr_T)(added > 0 ? (p - oldline) : ind_len), added);
+ }
#endif
retval = TRUE;
}