aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2017-01-09 20:49:47 +0100
committerJames McCoy <jamessan@jamessan.com>2017-02-04 17:55:46 -0500
commitb0cf071d437699b9b89e3735b3df41914f302eb1 (patch)
treeec6f0ce799cc1ab9b0c195896f67b3d8f82ece7b /src/nvim/fileio.c
parentd3f97232e8aa94ccb463aadd0c698fd506dfe9ca (diff)
downloadrneovim-b0cf071d437699b9b89e3735b3df41914f302eb1.tar.gz
rneovim-b0cf071d437699b9b89e3735b3df41914f302eb1.tar.bz2
rneovim-b0cf071d437699b9b89e3735b3df41914f302eb1.zip
Fix clint issues
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 7b726e9f1a..cdb912ca94 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -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 */