diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-17 22:57:26 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-17 22:57:26 +0200 |
commit | 8055d17388736421d875dd4933c4c93d49a2ab58 (patch) | |
tree | 81ebca77b3ed10b02f42f8513c29b838ac7952fb /src/misc1.c | |
parent | 787880a86dbcb79cdf6e8241b1d99ac4a7acbc09 (diff) | |
download | vim-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/misc1.c')
-rw-r--r-- | src/misc1.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/misc1.c b/src/misc1.c index 5dcf26848..f83e80795 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -434,8 +434,15 @@ set_indent( 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; } |