Mercurial > vim
comparison src/memline.c @ 25050:7ef7a211f6bf v8.2.3062
patch 8.2.3062: internal error when adding several text properties
Commit: https://github.com/vim/vim/commit/4cd5c52d64a66ad1984d33462a40e0c6721ca232
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 27 13:04:00 2021 +0200
patch 8.2.3062: internal error when adding several text properties
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 27 Jun 2021 13:15:03 +0200 |
parents | 85d1e82ed134 |
children | a37cf57980f9 |
comparison
equal
deleted
inserted
replaced
25049:e700f4d4aef4 | 25050:7ef7a211f6bf |
---|---|
3660 netbeans_removed(buf, lnum, 0, (long)line_size); | 3660 netbeans_removed(buf, lnum, 0, (long)line_size); |
3661 #endif | 3661 #endif |
3662 #ifdef FEAT_PROP_POPUP | 3662 #ifdef FEAT_PROP_POPUP |
3663 // If there are text properties, make a copy, so that we can update | 3663 // If there are text properties, make a copy, so that we can update |
3664 // properties in preceding and following lines. | 3664 // properties in preceding and following lines. |
3665 if (buf->b_has_textprop && !(flags & ML_DEL_UNDO)) | 3665 if (buf->b_has_textprop && !(flags & (ML_DEL_UNDO | ML_DEL_NOPROP))) |
3666 { | 3666 { |
3667 size_t textlen = STRLEN((char_u *)dp + line_start) + 1; | 3667 size_t textlen = STRLEN((char_u *)dp + line_start) + 1; |
3668 | 3668 |
3669 if ((long)textlen < line_size) | 3669 if ((long)textlen < line_size) |
3670 { | 3670 { |
3763 #ifdef FEAT_PROP_POPUP | 3763 #ifdef FEAT_PROP_POPUP |
3764 if (textprop_save != NULL) | 3764 if (textprop_save != NULL) |
3765 { | 3765 { |
3766 // Adjust text properties in the line above and below. | 3766 // Adjust text properties in the line above and below. |
3767 if (lnum > 1) | 3767 if (lnum > 1) |
3768 adjust_text_props_for_delete(buf, lnum - 1, textprop_save, textprop_save_len, TRUE); | 3768 adjust_text_props_for_delete(buf, lnum - 1, textprop_save, |
3769 textprop_save_len, TRUE); | |
3769 if (lnum <= buf->b_ml.ml_line_count) | 3770 if (lnum <= buf->b_ml.ml_line_count) |
3770 adjust_text_props_for_delete(buf, lnum, textprop_save, textprop_save_len, FALSE); | 3771 adjust_text_props_for_delete(buf, lnum, textprop_save, |
3772 textprop_save_len, FALSE); | |
3771 } | 3773 } |
3772 vim_free(textprop_save); | 3774 vim_free(textprop_save); |
3773 #endif | 3775 #endif |
3774 return ret; | 3776 return ret; |
3775 } | 3777 } |
4019 ((dp->db_index[idx] & DB_MARKED) ? ML_APPEND_MARK : 0) | 4021 ((dp->db_index[idx] & DB_MARKED) ? ML_APPEND_MARK : 0) |
4020 #ifdef FEAT_PROP_POPUP | 4022 #ifdef FEAT_PROP_POPUP |
4021 | ML_APPEND_NOPROP | 4023 | ML_APPEND_NOPROP |
4022 #endif | 4024 #endif |
4023 ); | 4025 ); |
4024 (void)ml_delete_int(buf, lnum, 0); | 4026 (void)ml_delete_int(buf, lnum, ML_DEL_NOPROP); |
4025 } | 4027 } |
4026 } | 4028 } |
4027 vim_free(new_line); | 4029 vim_free(new_line); |
4028 | 4030 |
4029 entered = FALSE; | 4031 entered = FALSE; |