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:
12
src/ops.c
12
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();
|
||||
|
Reference in New Issue
Block a user