Problem: ml_delete() often called with FALSE argument.
Solution: Use ml_delete_flags(x, ML_DEL_MESSAGE) when argument is TRUE.
{
// Delete the binary lines.
while (--line_count >= 0)
- ml_delete((linenr_T)1, FALSE);
+ ml_delete((linenr_T)1);
}
else
{
// Delete the converted lines.
while (curbuf->b_ml.ml_line_count > line_count)
- ml_delete(line_count, FALSE);
+ ml_delete(line_count);
}
// Put the cursor on the first line.
curwin->w_cursor.lnum = 1;
if (curbuf->b_ml.ml_flags & ML_EMPTY) // nothing to delete
break;
- ml_delete(first, TRUE);
+ ml_delete_flags(first, ML_DEL_MESSAGE);
++n;
// If we delete the last line in the file, stop
{
// remember deleting the last line of the buffer
buf_empty = curbuf->b_ml.ml_line_count == 1;
- ml_delete(lnum, FALSE);
+ ml_delete(lnum);
--added;
}
for (i = 0; i < dp->df_count[idx_from] - start_skip - end_skip; ++i)
// Added the first line into an empty buffer, need to
// delete the dummy empty line.
buf_empty = FALSE;
- ml_delete((linenr_T)2, FALSE);
+ ml_delete((linenr_T)2);
}
}
}
}
for (lnum = first; lnum <= last; ++lnum)
- ml_delete(first, TRUE);
+ ml_delete_flags(first, ML_DEL_MESSAGE);
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_buffer == buf)
// delete the original lines if appending worked
if (i == count)
for (i = 0; i < count; ++i)
- ml_delete(eap->line1, FALSE);
+ ml_delete(eap->line1);
else
count = 0;
return FAIL;
for (l = line1; l <= line2; l++)
- ml_delete(line1 + extra, TRUE);
+ ml_delete_flags(line1 + extra, ML_DEL_MESSAGE);
if (!global_busy && num_lines > p_report)
smsg(NGETTEXT("%ld line moved", "%ld lines moved", num_lines),
if (empty)
{
- ml_delete(2L, FALSE);
+ ml_delete(2L);
empty = FALSE;
}
}
{
if (curbuf->b_ml.ml_flags & ML_EMPTY) // nothing to delete
break;
- ml_delete(eap->line1, FALSE);
+ ml_delete(eap->line1);
}
// make sure the cursor is not beyond the end of the file now
if (u_savedel(lnum, nmatch_tl) != OK)
break;
for (i = 0; i < nmatch_tl; ++i)
- ml_delete(lnum, (int)FALSE);
+ ml_delete(lnum);
mark_adjust(lnum, lnum + nmatch_tl - 1,
(long)MAXLNUM, -nmatch_tl);
if (subflags.do_ask)
lnum = 1;
if (*ml_get(lnum) == NUL && u_savedel(lnum, 1L) == OK)
{
- ml_delete(lnum, FALSE);
+ ml_delete(lnum);
if (curwin->w_cursor.lnum > 1
&& curwin->w_cursor.lnum >= lnum)
--curwin->w_cursor.lnum;
}
// Delete the previously read lines.
while (lnum > from)
- ml_delete(lnum--, FALSE);
+ ml_delete(lnum--);
file_rewind = FALSE;
if (set_options)
{
#ifdef FEAT_NETBEANS_INTG
netbeansFireChanges = 0;
#endif
- ml_delete(curbuf->b_ml.ml_line_count, FALSE);
+ ml_delete(curbuf->b_ml.ml_line_count);
#ifdef FEAT_NETBEANS_INTG
netbeansFireChanges = 1;
#endif
{
curbuf = frombuf;
for (lnum = curbuf->b_ml.ml_line_count; lnum > 0; --lnum)
- if (ml_delete(lnum, FALSE) == FAIL)
+ if (ml_delete(lnum) == FAIL)
{
// Oops! We could try putting back the saved lines, but that
// might fail again...
// Put the text back from the save buffer. First
// delete any lines that readfile() added.
while (!BUFEMPTY())
- if (ml_delete(buf->b_ml.ml_line_count, FALSE) == FAIL)
+ if (ml_delete(buf->b_ml.ml_line_count) == FAIL)
break;
(void)move_lines(savebuf, buf);
}
curbuf = buf;
luaL_error(L, "cannot save undo information");
}
- else if (ml_delete(n, FALSE) == FAIL)
+ else if (ml_delete(n) == FAIL)
{
curbuf = buf;
luaL_error(L, "cannot delete line");
curbuf = savebuf;
raise_vim_exn(_("cannot save undo information"));
}
- else if (ml_delete((linenr_T)n, FALSE) == FAIL)
+ else if (ml_delete((linenr_T)n) == FAIL)
{
curbuf = savebuf;
raise_vim_exn(_("cannot delete line"));
else
{
for (i = 0; i < old_len; i++)
- if (ml_delete((linenr_T)lo, FALSE) == FAIL)
+ if (ml_delete((linenr_T)lo) == FAIL)
{
curbuf = savebuf;
raise_vim_exn(_("cannot delete line"));
*/
for (i = 0; i < old_len - new_len; ++i)
{
- if (ml_delete((linenr_T)lo, FALSE) == FAIL)
+ if (ml_delete((linenr_T)lo) == FAIL)
{
curbuf = savebuf;
free_array(array);
}
else
{
- ml_delete(*line, FALSE);
+ ml_delete(*line);
deleted_lines_mark(*line, 1L);
--(*end);
--(*line);
if (u_savedel(lnum, 1) == OK)
{
- ml_delete(lnum, 0);
+ ml_delete(lnum);
check_cursor();
deleted_lines_mark(lnum, 1L);
}
if (u_savedel((linenr_T)n, 1L) == FAIL)
RAISE_UNDO_FAIL;
- else if (ml_delete((linenr_T)n, FALSE) == FAIL)
+ else if (ml_delete((linenr_T)n) == FAIL)
RAISE_DELETE_LINE_FAIL;
else
{
{
for (i = 0; i < n; ++i)
{
- if (ml_delete((linenr_T)lo, FALSE) == FAIL)
+ if (ml_delete((linenr_T)lo) == FAIL)
{
RAISE_DELETE_LINE_FAIL;
break;
if (!PyErr_Occurred())
{
for (i = 0; i < old_len - new_len; ++i)
- if (ml_delete((linenr_T)lo, FALSE) == FAIL)
+ if (ml_delete((linenr_T)lo) == FAIL)
{
RAISE_DELETE_LINE_FAIL;
break;
if (u_savedel(n, 1) == OK)
{
- ml_delete(n, 0);
+ ml_delete(n);
// Changes to non-active buffers should properly refresh
// SegPhault - 01/09/05
i = n;
do
{
- if (ml_delete((linenr_T)i, FALSE) != OK)
+ if (ml_delete((linenr_T)i) != OK)
goto setListError;
++n;
} while (n <= val2);
}
for (i = 0; i < n; i++)
{
- ml_delete((linenr_T)val1, FALSE);
+ ml_delete((linenr_T)val1);
err = vimerror(interp);
if (err != TCL_OK)
break;
* contents of the current buffer.
*/
while (!(curbuf->b_ml.ml_flags & ML_EMPTY))
- ml_delete((linenr_T)1, FALSE);
+ ml_delete((linenr_T)1);
/*
* Try reading the original file to obtain the values of 'fileformat',
*/
while (curbuf->b_ml.ml_line_count > lnum
&& !(curbuf->b_ml.ml_flags & ML_EMPTY))
- ml_delete(curbuf->b_ml.ml_line_count, FALSE);
+ ml_delete(curbuf->b_ml.ml_line_count);
curbuf->b_flags |= BF_RECOVERED;
recoverymode = FALSE;
* return FAIL for failure, OK otherwise
*/
int
-ml_delete(linenr_T lnum, int message)
+ml_delete(linenr_T lnum)
{
- return ml_delete_flags(lnum, message ? ML_DEL_MESSAGE : 0);
+ return ml_delete_flags(lnum, 0);
}
/*
// line that needs to be deleted now.
if (empty && *ml_get(curbuf->b_ml.ml_line_count) == NUL)
{
- ml_delete(curbuf->b_ml.ml_line_count, TRUE);
+ ml_delete_flags(curbuf->b_ml.ml_line_count, ML_DEL_MESSAGE);
deleted_lines(curbuf->b_ml.ml_line_count + 1, 1);
// If the cursor was in that line, move it to the end of the last
{
// Already a "wipeout" buffer, make it empty.
while (!BUFEMPTY())
- ml_delete((linenr_T)1, FALSE);
+ ml_delete((linenr_T)1);
}
else
{
}
}
// delete the empty last line
- ml_delete(curbuf->b_ml.ml_line_count, FALSE);
+ ml_delete(curbuf->b_ml.ml_line_count);
// Increase the height of the preview window to show the
// text, but no more than 'previewheight' lines.
// Clear the buffer, then replace the lines.
curbuf = buf;
for (lnum = buf->b_ml.ml_line_count; lnum > 0; --lnum)
- ml_delete(lnum, FALSE);
+ ml_delete(lnum);
curbuf = curwin->w_buffer;
// Add text to the buffer.
// delete the line that was in the empty buffer
curbuf = buf;
- ml_delete(buf->b_ml.ml_line_count, FALSE);
+ ml_delete(buf->b_ml.ml_line_count);
curbuf = curwin->w_buffer;
}
int ml_append_buf(buf_T *buf, linenr_T lnum, char_u *line, colnr_T len, int newfile);
int ml_replace(linenr_T lnum, char_u *line, int copy);
int ml_replace_len(linenr_T lnum, char_u *line_arg, colnr_T len_arg, int has_props, int copy);
-int ml_delete(linenr_T lnum, int message);
+int ml_delete(linenr_T lnum);
int ml_delete_flags(linenr_T lnum, int flags);
void ml_setmarked(linenr_T lnum);
linenr_T ml_firstmarked(void);
// delete all existing lines
while ((curbuf->b_ml.ml_flags & ML_EMPTY) == 0)
- (void)ml_delete((linenr_T)1, FALSE);
+ (void)ml_delete((linenr_T)1);
}
// Check if there is anything to display
if (old_last == NULL)
// Delete the empty line which is now at the end
- (void)ml_delete(lnum + 1, FALSE);
+ (void)ml_delete(lnum + 1);
}
// correct cursor position
// Delete the empty line that we started with.
if (curbuf->b_ml.ml_line_count > 1)
- ml_delete(curbuf->b_ml.ml_line_count, FALSE);
+ ml_delete(curbuf->b_ml.ml_line_count);
redraw_later(NOT_VALID);
}
{
// Delete the empty line that was in the empty buffer.
curbuf = buf;
- ml_delete(1, FALSE);
+ ml_delete(1);
curbuf = curwin->w_buffer;
}
}
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;
{
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;
{
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);
}
}
// 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)
if (p == NULL)
return OK;
ml_append(bot_start, p, 0, FALSE);
- ml_delete(1, FALSE);
+ ml_delete(1);
vim_free(p);
}
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);
}
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);
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 853,
/**/
852,
/**/