Fix lint errors.

This commit is contained in:
Grzegorz Milka 2016-10-23 00:56:15 +02:00
parent 9755a2ffd5
commit d357a42389
5 changed files with 25 additions and 20 deletions

View File

@ -324,12 +324,13 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last)
}
if (win_valid_any_tab(win)) {
/* Set b_last_cursor when closing the last window for the buffer.
* Remember the last cursor position and window options of the buffer.
* This used to be only for the current window, but then options like
* 'foldmethod' may be lost with a ":only" command. */
if (buf->b_nwindows == 1)
// Set b_last_cursor when closing the last window for the buffer.
// Remember the last cursor position and window options of the buffer.
// This used to be only for the current window, but then options like
// 'foldmethod' may be lost with a ":only" command.
if (buf->b_nwindows == 1) {
set_last_cursor(win);
}
buflist_setfpos(buf, win,
win->w_cursor.lnum == 1 ? 0 : win->w_cursor.lnum,
win->w_cursor.col, TRUE);
@ -517,8 +518,9 @@ void buf_freeall(buf_T *buf, int flags)
goto_tabpage_win(the_curtab, the_curwin);
unblock_autocmds();
}
if (aborting()) /* autocmds may abort script processing */
if (aborting()) { // autocmds may abort script processing
return;
}
/*
* It's possible that autocommands change curbuf to the one being deleted.

View File

@ -2250,23 +2250,25 @@ do_ecmd (
xfree(new_name);
goto theend;
}
if (buf == curbuf) /* already in new buffer */
auto_buf = TRUE;
else {
win_T *the_curwin = curwin;
if (buf == curbuf) { // already in new buffer
auto_buf = true;
} else {
win_T *the_curwin = curwin;
// Set the w_closing flag to avoid that autocommands close the window.
the_curwin->w_closing = TRUE;
if (curbuf == old_curbuf)
the_curwin->w_closing = true;
if (curbuf == old_curbuf) {
buf_copy_options(buf, BCO_ENTER);
}
// Close the link to the current buffer. This will set
// curwin->w_buffer to NULL.
u_sync(FALSE);
u_sync(false);
close_buffer(oldwin, curbuf,
(flags & ECMD_HIDE) || curbuf->terminal ? 0 : DOBUF_UNLOAD, FALSE);
(flags & ECMD_HIDE) || curbuf->terminal ? 0 : DOBUF_UNLOAD,
false);
the_curwin->w_closing = FALSE;
the_curwin->w_closing = false;
// autocmds may abort script processing
if (aborting() && curwin->w_buffer != NULL) {

View File

@ -1771,7 +1771,7 @@ static char_u * do_one_cmd(char_u **cmdlinep,
if (text_locked() && !(ea.argt & CMDWIN)
&& !IS_USER_CMDIDX(ea.cmdidx)) {
/* Command not allowed when editing the command line. */
// Command not allowed when editing the command line.
errormsg = get_text_locked_msg();
goto doend;
}

View File

@ -1692,10 +1692,11 @@ void text_locked_msg(void)
}
char_u * get_text_locked_msg(void) {
if (cmdwin_type != 0)
if (cmdwin_type != 0) {
return e_cmdwin;
else
} else {
return e_secure;
}
}
/*

View File

@ -2052,7 +2052,7 @@ void win_close_othertab(win_T *win, int free_buf, tabpage_T *tp)
if (win->w_buffer != NULL) {
// Close the link to the buffer.
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, FALSE);
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, false);
}
/* Careful: Autocommands may have closed the tab page or made it the
@ -3242,7 +3242,7 @@ void goto_tabpage(int n)
int i;
if (text_locked()) {
/* Not allowed when editing the command line. */
// Not allowed when editing the command line.
text_locked_msg();
return;
}