aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGrzegorz Milka <grzegorzmilka@gmail.com>2016-10-23 00:56:15 +0200
committerGrzegorz Milka <grzegorzmilka@gmail.com>2016-10-23 01:17:39 +0200
commitd357a42389752b5270cf590b2f078f836de6c736 (patch)
tree4d7385d3171a7c63e2ab152a4e781fe49e29fe62 /src
parent9755a2ffd5727c7fc0576e60a21368618978c504 (diff)
downloadrneovim-d357a42389752b5270cf590b2f078f836de6c736.tar.gz
rneovim-d357a42389752b5270cf590b2f078f836de6c736.tar.bz2
rneovim-d357a42389752b5270cf590b2f078f836de6c736.zip
Fix lint errors.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/buffer.c14
-rw-r--r--src/nvim/ex_cmds.c20
-rw-r--r--src/nvim/ex_docmd.c2
-rw-r--r--src/nvim/ex_getln.c5
-rw-r--r--src/nvim/window.c4
5 files changed, 25 insertions, 20 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index fc6e46cf64..e6a7950d53 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -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.
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 79ee69bb56..f19a9206a4 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -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) {
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 5c84b5bb4e..5e418bf099 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -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;
}
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index a58cdd5c6b..e525c949bd 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -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;
+ }
}
/*
diff --git a/src/nvim/window.c b/src/nvim/window.c
index e7be1fb7f8..9c6a2e26a6 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -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;
}