mirror of
https://github.com/neovim/neovim.git
synced 2025-09-09 12:58:16 +00:00
window: refactor boolean variables in win_close()
free_buf (param) and help_window (variable) are bool.
This commit is contained in:
@@ -842,7 +842,7 @@ void goto_buffer(exarg_T *eap, int start, int dir, int count)
|
||||
enter_cleanup(&cs);
|
||||
|
||||
/* Quitting means closing the split window, nothing else. */
|
||||
win_close(curwin, TRUE);
|
||||
win_close(curwin, true);
|
||||
swap_exists_action = SEA_NONE;
|
||||
swap_exists_did_quit = TRUE;
|
||||
|
||||
@@ -4651,7 +4651,7 @@ void ex_buffer_all(exarg_T *eap)
|
||||
&& !ONE_WINDOW
|
||||
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
|
||||
) {
|
||||
win_close(wp, FALSE);
|
||||
win_close(wp, false);
|
||||
wpnext = firstwin; /* just in case an autocommand does
|
||||
something strange with windows */
|
||||
tpnext = first_tabpage; /* start all over...*/
|
||||
@@ -4724,7 +4724,7 @@ void ex_buffer_all(exarg_T *eap)
|
||||
enter_cleanup(&cs);
|
||||
|
||||
/* User selected Quit at ATTENTION prompt; close this window. */
|
||||
win_close(curwin, TRUE);
|
||||
win_close(curwin, true);
|
||||
--open_wins;
|
||||
swap_exists_action = SEA_NONE;
|
||||
swap_exists_did_quit = TRUE;
|
||||
|
@@ -5510,7 +5510,7 @@ void ex_helpclose(exarg_T *eap)
|
||||
{
|
||||
FOR_ALL_WINDOWS_IN_TAB(win, curtab) {
|
||||
if (bt_help(win->w_buffer)) {
|
||||
win_close(win, FALSE);
|
||||
win_close(win, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -6192,7 +6192,7 @@ static int open_cmdwin(void)
|
||||
wp = curwin;
|
||||
set_bufref(&bufref, curbuf);
|
||||
win_goto(old_curwin);
|
||||
win_close(wp, TRUE);
|
||||
win_close(wp, true);
|
||||
|
||||
// win_close() may have already wiped the buffer when 'bh' is
|
||||
// set to 'wipe'.
|
||||
|
@@ -1551,7 +1551,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) {
|
||||
win_close(curwin, TRUE);
|
||||
win_close(curwin, true);
|
||||
advance = FALSE;
|
||||
}
|
||||
|
||||
@@ -1563,7 +1563,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;
|
||||
win_close(curwin, TRUE);
|
||||
win_close(curwin, true);
|
||||
advance = FALSE;
|
||||
continue;
|
||||
}
|
||||
@@ -1598,7 +1598,7 @@ static void edit_buffers(mparm_T *parmp, char_u *cwd)
|
||||
did_emsg = FALSE; /* avoid hit-enter prompt */
|
||||
getout(1);
|
||||
}
|
||||
win_close(curwin, TRUE);
|
||||
win_close(curwin, true);
|
||||
advance = FALSE;
|
||||
}
|
||||
if (arg_idx == GARGCOUNT - 1)
|
||||
|
@@ -2598,7 +2598,7 @@ void ex_cclose(exarg_T *eap)
|
||||
/* Find existing quickfix window and close it. */
|
||||
win = qf_find_win(qi);
|
||||
if (win != NULL)
|
||||
win_close(win, FALSE);
|
||||
win_close(win, false);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -2612,7 +2612,7 @@ static int jumpto_tag(
|
||||
} else {
|
||||
--RedrawingDisabled;
|
||||
if (postponed_split) { /* close the window */
|
||||
win_close(curwin, FALSE);
|
||||
win_close(curwin, false);
|
||||
postponed_split = 0;
|
||||
}
|
||||
}
|
||||
|
@@ -1859,20 +1859,18 @@ static bool close_last_window_tabpage(win_T *win, bool free_buf,
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Close window "win". Only works for the current tab page.
|
||||
* If "free_buf" is TRUE related buffer may be unloaded.
|
||||
*
|
||||
* Called by :quit, :close, :xit, :wq and findtag().
|
||||
* Returns FAIL when the window was not closed.
|
||||
*/
|
||||
int win_close(win_T *win, int free_buf)
|
||||
// Close window "win". Only works for the current tab page.
|
||||
// If "free_buf" is true related buffer may be unloaded.
|
||||
//
|
||||
// Called by :quit, :close, :xit, :wq and findtag().
|
||||
// Returns FAIL when the window was not closed.
|
||||
int win_close(win_T *win, bool free_buf)
|
||||
{
|
||||
win_T *wp;
|
||||
int other_buffer = FALSE;
|
||||
int close_curwin = FALSE;
|
||||
int dir;
|
||||
int help_window = FALSE;
|
||||
bool help_window = false;
|
||||
tabpage_T *prev_curtab = curtab;
|
||||
frame_T *win_frame = win->w_frame->fr_parent;
|
||||
|
||||
@@ -1903,7 +1901,7 @@ int win_close(win_T *win, int 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))
|
||||
help_window = TRUE;
|
||||
help_window = true;
|
||||
else
|
||||
clear_snapshot(curtab, SNAP_HELP_IDX);
|
||||
|
||||
|
Reference in New Issue
Block a user