diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-06-27 13:04:00 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-06-27 13:04:00 +0200 |
commit | 4cd5c52d64a66ad1984d33462a40e0c6721ca232 (patch) | |
tree | 6030ab9a9e9971692340d7f71189c245d2b90924 /src/memline.c | |
parent | 054794c20f6322bbd9482c4124041dc0a140c78e (diff) | |
download | vim-git-4cd5c52d64a66ad1984d33462a40e0c6721ca232.tar.gz |
patch 8.2.3062: internal error when adding several text propertiesv8.2.3062
Problem: Internal error when adding several text properties.
Solution: Do not handle text properties when deleting a line for splitting a
data block. (closes #8466)
Diffstat (limited to 'src/memline.c')
-rw-r--r-- | src/memline.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/memline.c b/src/memline.c index f1c2a8a52..0eac1cdcb 100644 --- a/src/memline.c +++ b/src/memline.c @@ -3662,7 +3662,7 @@ ml_delete_int(buf_T *buf, linenr_T lnum, int flags) #ifdef FEAT_PROP_POPUP // If there are text properties, make a copy, so that we can update // properties in preceding and following lines. - if (buf->b_has_textprop && !(flags & ML_DEL_UNDO)) + if (buf->b_has_textprop && !(flags & (ML_DEL_UNDO | ML_DEL_NOPROP))) { size_t textlen = STRLEN((char_u *)dp + line_start) + 1; @@ -3765,9 +3765,11 @@ theend: { // Adjust text properties in the line above and below. if (lnum > 1) - adjust_text_props_for_delete(buf, lnum - 1, textprop_save, textprop_save_len, TRUE); + adjust_text_props_for_delete(buf, lnum - 1, textprop_save, + textprop_save_len, TRUE); if (lnum <= buf->b_ml.ml_line_count) - adjust_text_props_for_delete(buf, lnum, textprop_save, textprop_save_len, FALSE); + adjust_text_props_for_delete(buf, lnum, textprop_save, + textprop_save_len, FALSE); } vim_free(textprop_save); #endif @@ -4021,7 +4023,7 @@ ml_flush_line(buf_T *buf) | ML_APPEND_NOPROP #endif ); - (void)ml_delete_int(buf, lnum, 0); + (void)ml_delete_int(buf, lnum, ML_DEL_NOPROP); } } vim_free(new_line); |