Fix clint issues

This commit is contained in:
Marco Hinz
2017-01-09 20:49:47 +01:00
committed by James McCoy
parent d3f97232e8
commit b0cf071d43
5 changed files with 24 additions and 19 deletions

View File

@@ -5127,11 +5127,13 @@ void buf_reload(buf_T *buf, int orig_mode)
EMSG2(_("E321: Could not reload \"%s\""), buf->b_fname);
}
if (savebuf != NULL && bufref_valid(&bufref) && buf == curbuf) {
/* 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)
// 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) {
break;
}
}
(void)move_lines(savebuf, buf);
}
} else if (buf == curbuf) { /* "buf" still valid */
@@ -6329,9 +6331,10 @@ void ex_doautoall(exarg_T *eap)
/* restore the current window */
aucmd_restbuf(&aco);
/* stop if there is some error or buffer was deleted */
if (retval == FAIL || !bufref_valid(&bufref))
// Stop if there is some error or buffer was deleted.
if (retval == FAIL || !bufref_valid(&bufref)) {
break;
}
}
check_cursor(); /* just in case lines got deleted */