1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar
2020-05-30 20:30:46 +02:00
parent d6cd5ffade
commit ca70c07b72
22 changed files with 52 additions and 50 deletions

View File

@@ -1609,7 +1609,7 @@ add_scrollback_line_to_buffer(term_T *term, char_u *text, int len)
{
// Delete the empty line that was in the empty buffer.
curbuf = buf;
ml_delete(1, FALSE);
ml_delete(1);
curbuf = curwin->w_buffer;
}
}
@@ -1683,7 +1683,7 @@ cleanup_scrollback(term_T *term)
while (curbuf->b_ml.ml_line_count > term->tl_scrollback_scrolled
&& gap->ga_len > 0)
{
ml_delete(curbuf->b_ml.ml_line_count, FALSE);
ml_delete(curbuf->b_ml.ml_line_count);
line = (sb_line_T *)gap->ga_data + gap->ga_len - 1;
vim_free(line->sb_cells);
--gap->ga_len;
@@ -3142,7 +3142,7 @@ limit_scrollback(term_T *term, garray_T *gap, int update_buffer)
{
vim_free(((sb_line_T *)gap->ga_data + i)->sb_cells);
if (update_buffer)
ml_delete(1, FALSE);
ml_delete(1);
}
curbuf = curwin->w_buffer;
@@ -5148,7 +5148,7 @@ term_load_dump(typval_T *argvars, typval_T *rettv, int do_diff)
{
buf = curbuf;
while (!(curbuf->b_ml.ml_flags & ML_EMPTY))
ml_delete((linenr_T)1, FALSE);
ml_delete((linenr_T)1);
free_scrollback(curbuf->b_term);
redraw_later(NOT_VALID);
}
@@ -5183,7 +5183,7 @@ term_load_dump(typval_T *argvars, typval_T *rettv, int do_diff)
}
// Delete the empty line that was in the empty buffer.
ml_delete(1, FALSE);
ml_delete(1);
// For term_dumpload() we are done here.
if (!do_diff)
@@ -5374,7 +5374,7 @@ term_swap_diff()
if (p == NULL)
return OK;
ml_append(bot_start, p, 0, FALSE);
ml_delete(1, FALSE);
ml_delete(1);
vim_free(p);
}
@@ -5384,7 +5384,7 @@ term_swap_diff()
p = vim_strsave(ml_get(bot_start + lnum));
if (p == NULL)
return OK;
ml_delete(bot_start + lnum, FALSE);
ml_delete(bot_start + lnum);
ml_append(lnum - 1, p, 0, FALSE);
vim_free(p);
}
@@ -5394,14 +5394,14 @@ term_swap_diff()
if (p == NULL)
return OK;
ml_append(line_count - top_rows - 1, p, 0, FALSE);
ml_delete(bot_rows + 1, FALSE);
ml_delete(bot_rows + 1);
vim_free(p);
// move bottom title to top
p = vim_strsave(ml_get(line_count - top_rows));
if (p == NULL)
return OK;
ml_delete(line_count - top_rows, FALSE);
ml_delete(line_count - top_rows);
ml_append(bot_rows, p, 0, FALSE);
vim_free(p);