aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-09-05 23:04:54 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-09-06 20:26:30 -0400
commit2be853d486be2cac3b04efbf425afac2dd9361a3 (patch)
tree9e3206063676ecf5353794d343c8fdd477fc7ee5
parentc0d26ba4f9a5a531e062fdfe96dddaeed56cdcc2 (diff)
downloadrneovim-2be853d486be2cac3b04efbf425afac2dd9361a3.tar.gz
rneovim-2be853d486be2cac3b04efbf425afac2dd9361a3.tar.bz2
rneovim-2be853d486be2cac3b04efbf425afac2dd9361a3.zip
lint
-rw-r--r--src/nvim/buffer.c12
-rw-r--r--src/nvim/main.c2
-rw-r--r--src/nvim/quickfix.c13
-rw-r--r--src/nvim/tag.c6
-rw-r--r--src/nvim/window.c8
5 files changed, 23 insertions, 18 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 5f832bfcf3..384c7f77b2 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -841,7 +841,7 @@ void goto_buffer(exarg_T *eap, int start, int dir, int count)
* aborting() returns FALSE when closing a window. */
enter_cleanup(&cs);
- /* Quitting means closing the split window, nothing else. */
+ // Quitting means closing the split window, nothing else.
win_close(curwin, true);
swap_exists_action = SEA_NONE;
swap_exists_did_quit = TRUE;
@@ -4652,9 +4652,9 @@ void ex_buffer_all(exarg_T *eap)
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
) {
win_close(wp, false);
- wpnext = firstwin; /* just in case an autocommand does
- something strange with windows */
- tpnext = first_tabpage; /* start all over...*/
+ wpnext = firstwin; // just in case an autocommand does
+ // something strange with windows
+ tpnext = first_tabpage; // start all over...
open_wins = 0;
} else
++open_wins;
@@ -4723,9 +4723,9 @@ void ex_buffer_all(exarg_T *eap)
* aborting() returns FALSE when closing a window. */
enter_cleanup(&cs);
- /* User selected Quit at ATTENTION prompt; close this window. */
+ // User selected Quit at ATTENTION prompt; close this window.
win_close(curwin, true);
- --open_wins;
+ open_wins--;
swap_exists_action = SEA_NONE;
swap_exists_did_quit = TRUE;
diff --git a/src/nvim/main.c b/src/nvim/main.c
index fbcfe9a3ce..d5e37929b9 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -1562,7 +1562,7 @@ static void edit_buffers(mparm_T *parmp, char_u *cwd)
}
// When w_arg_idx is -1 remove the window (see create_windows()).
if (curwin->w_arg_idx == -1) {
- ++arg_idx;
+ arg_idx++;
win_close(curwin, true);
advance = false;
continue;
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index d719f2e0a1..1eb6b3b421 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1140,7 +1140,7 @@ qf_init_ext(
}
if (state.fd == NULL || !ferror(state.fd)) {
if (qfl->qf_index == 0) {
- /* no valid entry found */
+ // no valid entry found
qfl->qf_ptr = qfl->qf_start;
qfl->qf_index = 1;
qfl->qf_nonevalid = true;
@@ -1150,7 +1150,7 @@ qf_init_ext(
qfl->qf_ptr = qfl->qf_start;
}
}
- /* return number of matches */
+ // return number of matches
retval = qfl->qf_count;
goto qf_init_end;
}
@@ -2597,8 +2597,9 @@ void ex_cclose(exarg_T *eap)
/* Find existing quickfix window and close it. */
win = qf_find_win(qi);
- if (win != NULL)
+ if (win != NULL) {
win_close(win, false);
+ }
}
/*
@@ -4862,10 +4863,12 @@ void ex_helpgrep(exarg_T *eap)
/* If the help window is not opened or if it already points to the
* correct location list, then free the new location list. */
if (!bt_help(curwin->w_buffer) || curwin->w_llist == qi) {
- if (new_qi)
+ if (new_qi) {
ll_free_all(&qi);
- } else if (curwin->w_llist == NULL)
+ }
+ } else if (curwin->w_llist == NULL) {
curwin->w_llist = qi;
+ }
}
}
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 91f182dd50..54090afd71 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -2608,10 +2608,10 @@ static int jumpto_tag(
win_enter(curwin_save, true);
}
- --RedrawingDisabled;
+ RedrawingDisabled--;
} else {
- --RedrawingDisabled;
- if (postponed_split) { /* close the window */
+ RedrawingDisabled--;
+ if (postponed_split) { // close the window
win_close(curwin, false);
postponed_split = 0;
}
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 02bf10f9a7..6f382acd84 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -1900,10 +1900,11 @@ int win_close(win_T *win, bool free_buf)
/* When closing the help window, try restoring a snapshot after closing
* the window. Otherwise clear the snapshot, it's now invalid. */
- if (bt_help(win->w_buffer))
+ if (bt_help(win->w_buffer)) {
help_window = true;
- else
+ } else {
clear_snapshot(curtab, SNAP_HELP_IDX);
+ }
if (win == curwin) {
/*
@@ -1967,8 +1968,9 @@ int win_close(win_T *win, bool free_buf)
|| close_last_window_tabpage(win, free_buf, prev_curtab))) {
// Autocommands have closed all windows, quit now. Restore
// curwin->w_buffer, otherwise writing ShaDa file may fail.
- if (curwin->w_buffer == NULL)
+ if (curwin->w_buffer == NULL) {
curwin->w_buffer = curbuf;
+ }
getout(0);
}
// Autocommands may have moved to another tab page.