comparison src/diff.c @ 20599:d571231175b4 v8.2.0853

patch 8.2.0853: ml_delete() often called with FALSE argument Commit: https://github.com/vim/vim/commit/ca70c07b72c24aae3d141e67d08f50361f051af5 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 30 20:30:46 2020 +0200 patch 8.2.0853: ml_delete() often called with FALSE argument Problem: ml_delete() often called with FALSE argument. Solution: Use ml_delete_flags(x, ML_DEL_MESSAGE) when argument is TRUE.
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 May 2020 20:45:03 +0200
parents aadd1cae2ff5
children d9a2e5dcfd9f
comparison
equal deleted inserted replaced
20598:d14c5a4a8dfa 20599:d571231175b4
2762 added = 0; 2762 added = 0;
2763 for (i = 0; i < count; ++i) 2763 for (i = 0; i < count; ++i)
2764 { 2764 {
2765 // remember deleting the last line of the buffer 2765 // remember deleting the last line of the buffer
2766 buf_empty = curbuf->b_ml.ml_line_count == 1; 2766 buf_empty = curbuf->b_ml.ml_line_count == 1;
2767 ml_delete(lnum, FALSE); 2767 ml_delete(lnum);
2768 --added; 2768 --added;
2769 } 2769 }
2770 for (i = 0; i < dp->df_count[idx_from] - start_skip - end_skip; ++i) 2770 for (i = 0; i < dp->df_count[idx_from] - start_skip - end_skip; ++i)
2771 { 2771 {
2772 linenr_T nr; 2772 linenr_T nr;
2784 if (buf_empty && curbuf->b_ml.ml_line_count == 2) 2784 if (buf_empty && curbuf->b_ml.ml_line_count == 2)
2785 { 2785 {
2786 // Added the first line into an empty buffer, need to 2786 // Added the first line into an empty buffer, need to
2787 // delete the dummy empty line. 2787 // delete the dummy empty line.
2788 buf_empty = FALSE; 2788 buf_empty = FALSE;
2789 ml_delete((linenr_T)2, FALSE); 2789 ml_delete((linenr_T)2);
2790 } 2790 }
2791 } 2791 }
2792 } 2792 }
2793 new_count = dp->df_count[idx_to] + added; 2793 new_count = dp->df_count[idx_to] + added;
2794 dp->df_count[idx_to] = new_count; 2794 dp->df_count[idx_to] = new_count;