1
0
forked from aniani/vim

patch 8.1.2308: deleting text before zero-width textprop removes it

Problem:    Deleting text before zero-width textprop removes it.
Solution:   Keep zero-width textprop when deleting text.
This commit is contained in:
Bram Moolenaar
2019-11-16 20:41:51 +01:00
parent a37cb55da6
commit ecafcc15ca
3 changed files with 35 additions and 1 deletions

View File

@@ -1075,10 +1075,13 @@ adjust_prop_columns(
}
else if (bytes_added <= 0 && (tmp_prop.tp_col > col + 1))
{
int len_changed = FALSE;
if (tmp_prop.tp_col + bytes_added < col + 1)
{
tmp_prop.tp_len += (tmp_prop.tp_col - 1 - col) + bytes_added;
tmp_prop.tp_col = col + 1;
len_changed = TRUE;
}
else
tmp_prop.tp_col += bytes_added;
@@ -1086,7 +1089,7 @@ adjust_prop_columns(
if ((flags & APC_SAVE_FOR_UNDO) && !dirty)
u_savesub(lnum);
dirty = TRUE;
if (tmp_prop.tp_len <= 0)
if (len_changed && tmp_prop.tp_len <= 0)
continue; // drop this text property
}
else if (tmp_prop.tp_len > 0