aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2015-12-13 12:56:24 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2015-12-13 13:01:46 +0900
commitd1ec3f661a02dd0ea6d7fbf371a16aae336d1e78 (patch)
tree45ed0ab3e1ae612ddedbde24527dcd3756df0aeb /src/nvim/ex_cmds.c
parentf183cc14de40542899f1bad44943695b0ccf0e5c (diff)
downloadrneovim-d1ec3f661a02dd0ea6d7fbf371a16aae336d1e78.tar.gz
rneovim-d1ec3f661a02dd0ea6d7fbf371a16aae336d1e78.tar.bz2
rneovim-d1ec3f661a02dd0ea6d7fbf371a16aae336d1e78.zip
vim-patch:7.4.645
Problem: When splitting the window in a BufAdd autocommand while still in the first, empty buffer the window count is wrong. Solution: Do not reset b_nwindows to zero and don't increment it. https://github.com/vim/vim/commit/8da9bbfd02957b79edd595c8c7397453012510b0
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 3f19421a75..d902234ef7 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2112,7 +2112,6 @@ do_ecmd (
goto theend;
if (buf->b_ml.ml_mfp == NULL) { /* no memfile yet */
oldbuf = FALSE;
- buf->b_nwindows = 0;
} else { /* existing memfile */
oldbuf = TRUE;
(void)buf_check_timestamp(buf, FALSE);
@@ -2138,7 +2137,7 @@ do_ecmd (
* Make the (new) buffer the one used by the current window.
* If the old buffer becomes unused, free it if ECMD_HIDE is FALSE.
* If the current buffer was empty and has no file name, curbuf
- * is returned by buflist_new().
+ * is returned by buflist_new(), nothing to do here.
*/
if (buf != curbuf) {
/*
@@ -2225,8 +2224,7 @@ do_ecmd (
}
xfree(new_name);
au_new_curbuf = NULL;
- } else
- ++curbuf->b_nwindows;
+ }
curwin->w_pcmark.lnum = 1;
curwin->w_pcmark.col = 0;