aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-07-24 02:56:18 +0200
committerGitHub <noreply@github.com>2017-07-24 02:56:18 +0200
commit2b473a9df8dc4a6f0129ae3b0f830cdac3864620 (patch)
tree1f3153258386fec61320ee6bbbf2793c9cdb55b7 /src/nvim/buffer.c
parentd011facf456dc85308cf58b6f0c6a06c4ddd7bb2 (diff)
parent86f2c473dc0e5b3c886d71b2fee99e1f3c9849b6 (diff)
downloadrneovim-2b473a9df8dc4a6f0129ae3b0f830cdac3864620.tar.gz
rneovim-2b473a9df8dc4a6f0129ae3b0f830cdac3864620.tar.bz2
rneovim-2b473a9df8dc4a6f0129ae3b0f830cdac3864620.zip
Merge #7061 from ckelsel/vim-8.0.0069
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 90a564bb6a..724a8578ac 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1203,8 +1203,8 @@ do_buffer (
*/
while (buf == curbuf
&& !(curwin->w_closing || curwin->w_buffer->b_locked > 0)
- && (firstwin != lastwin || first_tabpage->tp_next != NULL)) {
- if (win_close(curwin, FALSE) == FAIL)
+ && (!ONE_WINDOW || first_tabpage->tp_next != NULL)) {
+ if (win_close(curwin, false) == FAIL)
break;
}
@@ -4428,15 +4428,17 @@ do_arg_all (
continue;
}
}
- /* don't close last window */
- if (firstwin == lastwin
- && (first_tabpage->tp_next == NULL || !had_tab))
- use_firstwin = TRUE;
- else {
+ // don't close last window
+ if (ONE_WINDOW
+ && (first_tabpage->tp_next == NULL || !had_tab)) {
+ use_firstwin = true;
+ } else {
win_close(wp, !P_HID(buf) && !bufIsChanged(buf));
- /* check if autocommands removed the next window */
- if (!win_valid(wpnext))
- wpnext = firstwin; /* start all over... */
+ // check if autocommands removed the next window
+ if (!win_valid(wpnext)) {
+ // start all over...
+ wpnext = firstwin;
+ }
}
}
}
@@ -4593,7 +4595,7 @@ void ex_buffer_all(exarg_T *eap)
- tabline_height()
: wp->w_width != Columns)
|| (had_tab > 0 && wp != firstwin))
- && firstwin != lastwin
+ && !ONE_WINDOW
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
) {
win_close(wp, FALSE);