1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2019-05-17 22:57:26 +02:00
parent 787880a86d
commit 8055d17388
7 changed files with 109 additions and 10 deletions

View File

@@ -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();