Mercurial > vim
comparison src/memline.c @ 24703:4bc0bda6857d v8.2.2890
patch 8.2.2890: text property duplicated when data block splits
Commit: https://github.com/vim/vim/commit/840f91f110c4790a145e76eec453326445290f21
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed May 26 22:32:10 2021 +0200
patch 8.2.2890: text property duplicated when data block splits
Problem: Text property duplicated when data block splits.
Solution: Do not continue text prop from previous line. (closes https://github.com/vim/vim/issues/8261)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 26 May 2021 22:45:03 +0200 |
parents | 5dfee9b1eabe |
children | 7334bf933510 |
comparison
equal
deleted
inserted
replaced
24702:057ebabe602c | 24703:4bc0bda6857d |
---|---|
2770 | 2770 |
2771 if (len == 0) | 2771 if (len == 0) |
2772 len = (colnr_T)STRLEN(line) + 1; // space needed for the text | 2772 len = (colnr_T)STRLEN(line) + 1; // space needed for the text |
2773 | 2773 |
2774 #ifdef FEAT_PROP_POPUP | 2774 #ifdef FEAT_PROP_POPUP |
2775 if (curbuf->b_has_textprop && lnum > 0 && !(flags & ML_APPEND_UNDO)) | 2775 if (curbuf->b_has_textprop && lnum > 0 |
2776 && !(flags & (ML_APPEND_UNDO | ML_APPEND_NOPROP))) | |
2776 // Add text properties that continue from the previous line. | 2777 // Add text properties that continue from the previous line. |
2777 add_text_props_for_append(buf, lnum, &line, &len, &tofree); | 2778 add_text_props_for_append(buf, lnum, &line, &len, &tofree); |
2778 #endif | 2779 #endif |
2779 | 2780 |
2780 space_needed = len + INDEX_SIZE; // space needed for text + index | 2781 space_needed = len + INDEX_SIZE; // space needed for text + index |
3990 * that has only one line. | 3991 * that has only one line. |
3991 * Don't forget to copy the mark! | 3992 * Don't forget to copy the mark! |
3992 */ | 3993 */ |
3993 // How about handling errors??? | 3994 // How about handling errors??? |
3994 (void)ml_append_int(buf, lnum, new_line, new_len, | 3995 (void)ml_append_int(buf, lnum, new_line, new_len, |
3995 (dp->db_index[idx] & DB_MARKED) ? ML_APPEND_MARK : 0); | 3996 ((dp->db_index[idx] & DB_MARKED) ? ML_APPEND_MARK : 0) |
3997 #ifdef FEAT_PROP_POPUP | |
3998 | ML_APPEND_NOPROP | |
3999 #endif | |
4000 ); | |
3996 (void)ml_delete_int(buf, lnum, 0); | 4001 (void)ml_delete_int(buf, lnum, 0); |
3997 } | 4002 } |
3998 } | 4003 } |
3999 vim_free(new_line); | 4004 vim_free(new_line); |
4000 | 4005 |