diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-11-16 20:41:51 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-11-16 20:41:51 +0100 |
commit | ecafcc15ca92ecb9c6b41dbb3b0fcdf89c9eff69 (patch) | |
tree | c9b4e5ecf302b46bfa77fa64cf242932df84e080 /src/textprop.c | |
parent | a37cb55da6ba44c5e85a22b03a91e1b663aceddf (diff) | |
download | vim-git-ecafcc15ca92ecb9c6b41dbb3b0fcdf89c9eff69.tar.gz |
patch 8.1.2308: deleting text before zero-width textprop removes itv8.1.2308
Problem: Deleting text before zero-width textprop removes it.
Solution: Keep zero-width textprop when deleting text.
Diffstat (limited to 'src/textprop.c')
-rw-r--r-- | src/textprop.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/textprop.c b/src/textprop.c index 71d671d6b..55844d3ba 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -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 |