comparison src/viminfo.c @ 27022:eebbcc83fb75 v8.2.4040

patch 8.2.4040: keeping track of allocated lines is too complicated Commit: https://github.com/vim/vim/commit/9f1a39a5d1cd7989ada2d1cb32f97d84360e050f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 8 15:39:39 2022 +0000 patch 8.2.4040: keeping track of allocated lines is too complicated Problem: Keeping track of allocated lines in user functions is too complicated. Solution: Instead of freeing individual lines keep them all until the end.
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Jan 2022 16:45:02 +0100
parents ac75c145f0a9
children c9474ae175f4
comparison
equal deleted inserted replaced
27021:7c33c227c1ed 27022:eebbcc83fb75
2728 // |<{value},{value} 2728 // |<{value},{value}
2729 if (*p == '<') 2729 if (*p == '<')
2730 { 2730 {
2731 // Continuation line of an unrecognized item. 2731 // Continuation line of an unrecognized item.
2732 if (writing) 2732 if (writing)
2733 ga_add_string(&virp->vir_barlines, virp->vir_line); 2733 ga_copy_string(&virp->vir_barlines, virp->vir_line);
2734 } 2734 }
2735 else 2735 else
2736 { 2736 {
2737 ga_init2(&values, sizeof(bval_T), 20); 2737 ga_init2(&values, sizeof(bval_T), 20);
2738 bartype = getdigits(&p); 2738 bartype = getdigits(&p);
2767 break; 2767 break;
2768 2768
2769 default: 2769 default:
2770 // copy unrecognized line (for future use) 2770 // copy unrecognized line (for future use)
2771 if (writing) 2771 if (writing)
2772 ga_add_string(&virp->vir_barlines, virp->vir_line); 2772 ga_copy_string(&virp->vir_barlines, virp->vir_line);
2773 } 2773 }
2774 for (i = 0; i < values.ga_len; ++i) 2774 for (i = 0; i < values.ga_len; ++i)
2775 { 2775 {
2776 vp = (bval_T *)values.ga_data + i; 2776 vp = (bval_T *)values.ga_data + i;
2777 if (vp->bv_type == BVAL_STRING && vp->bv_allocated) 2777 if (vp->bv_type == BVAL_STRING && vp->bv_allocated)