comparison src/ex_cmds.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 18c52f380193
children c4bce986c31a
comparison
equal deleted inserted replaced
20598:d14c5a4a8dfa 20599:d571231175b4
631 } 631 }
632 632
633 // delete the original lines if appending worked 633 // delete the original lines if appending worked
634 if (i == count) 634 if (i == count)
635 for (i = 0; i < count; ++i) 635 for (i = 0; i < count; ++i)
636 ml_delete(eap->line1, FALSE); 636 ml_delete(eap->line1);
637 else 637 else
638 count = 0; 638 count = 0;
639 639
640 // Adjust marks for deleted (or added) lines and prepare for displaying. 640 // Adjust marks for deleted (or added) lines and prepare for displaying.
641 deleted = (long)(count - (lnum - eap->line2)); 641 deleted = (long)(count - (lnum - eap->line2));
777 */ 777 */
778 if (u_save(line1 + extra - 1, line2 + extra + 1) == FAIL) 778 if (u_save(line1 + extra - 1, line2 + extra + 1) == FAIL)
779 return FAIL; 779 return FAIL;
780 780
781 for (l = line1; l <= line2; l++) 781 for (l = line1; l <= line2; l++)
782 ml_delete(line1 + extra, TRUE); 782 ml_delete_flags(line1 + extra, ML_DEL_MESSAGE);
783 783
784 if (!global_busy && num_lines > p_report) 784 if (!global_busy && num_lines > p_report)
785 smsg(NGETTEXT("%ld line moved", "%ld lines moved", num_lines), 785 smsg(NGETTEXT("%ld line moved", "%ld lines moved", num_lines),
786 (long)num_lines); 786 (long)num_lines);
787 787
3278 vim_free(theline); 3278 vim_free(theline);
3279 ++lnum; 3279 ++lnum;
3280 3280
3281 if (empty) 3281 if (empty)
3282 { 3282 {
3283 ml_delete(2L, FALSE); 3283 ml_delete(2L);
3284 empty = FALSE; 3284 empty = FALSE;
3285 } 3285 }
3286 } 3286 }
3287 State = NORMAL; 3287 State = NORMAL;
3288 3288
3329 3329
3330 for (lnum = eap->line2; lnum >= eap->line1; --lnum) 3330 for (lnum = eap->line2; lnum >= eap->line1; --lnum)
3331 { 3331 {
3332 if (curbuf->b_ml.ml_flags & ML_EMPTY) // nothing to delete 3332 if (curbuf->b_ml.ml_flags & ML_EMPTY) // nothing to delete
3333 break; 3333 break;
3334 ml_delete(eap->line1, FALSE); 3334 ml_delete(eap->line1);
3335 } 3335 }
3336 3336
3337 // make sure the cursor is not beyond the end of the file now 3337 // make sure the cursor is not beyond the end of the file now
3338 check_cursor_lnum(); 3338 check_cursor_lnum();
3339 deleted_lines_mark(eap->line1, (long)(eap->line2 - lnum)); 3339 deleted_lines_mark(eap->line1, (long)(eap->line2 - lnum));
4529 */ 4529 */
4530 ++lnum; 4530 ++lnum;
4531 if (u_savedel(lnum, nmatch_tl) != OK) 4531 if (u_savedel(lnum, nmatch_tl) != OK)
4532 break; 4532 break;
4533 for (i = 0; i < nmatch_tl; ++i) 4533 for (i = 0; i < nmatch_tl; ++i)
4534 ml_delete(lnum, (int)FALSE); 4534 ml_delete(lnum);
4535 mark_adjust(lnum, lnum + nmatch_tl - 1, 4535 mark_adjust(lnum, lnum + nmatch_tl - 1,
4536 (long)MAXLNUM, -nmatch_tl); 4536 (long)MAXLNUM, -nmatch_tl);
4537 if (subflags.do_ask) 4537 if (subflags.do_ask)
4538 deleted_lines(lnum, nmatch_tl); 4538 deleted_lines(lnum, nmatch_tl);
4539 --lnum; 4539 --lnum;