diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-12-13 01:45:17 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-12-13 01:45:17 -0500 |
commit | c3e4e0e383401bdd0ac9cac4b81e1c4e160be166 (patch) | |
tree | 8b459de07b42b958e9129295e0373255a5be1d16 /src/nvim/buffer.c | |
parent | cd1be8350dd8fcc317cf1c618770b2bbdd4b94d5 (diff) | |
parent | d1ec3f661a02dd0ea6d7fbf371a16aae336d1e78 (diff) | |
download | rneovim-c3e4e0e383401bdd0ac9cac4b81e1c4e160be166.tar.gz rneovim-c3e4e0e383401bdd0ac9cac4b81e1c4e160be166.tar.bz2 rneovim-c3e4e0e383401bdd0ac9cac4b81e1c4e160be166.zip |
Merge pull request #3837 from Shougo/vim-7.4.645
vim-patch:7.4.645
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index fae8e9ecd0..762cd3efd3 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1414,7 +1414,6 @@ buflist_new ( return NULL; if (aborting()) /* autocmds may abort script processing */ return NULL; - /* buf->b_nwindows = 0; why was this here? */ free_buffer_stuff(buf, FALSE); /* delete local variables et al. */ /* Init the options. */ @@ -1475,6 +1474,9 @@ buflist_new ( fmarks_check_names(buf); /* check file marks for this file */ buf->b_p_bl = (flags & BLN_LISTED) ? TRUE : FALSE; /* init 'buflisted' */ if (!(flags & BLN_DUMMY)) { + // Tricky: these autocommands may change the buffer list. They could also + // split the window with re-using the one empty buffer. This may result in + // unexpectedly losing the empty buffer. apply_autocmds(EVENT_BUFNEW, NULL, NULL, FALSE, buf); if (!buf_valid(buf)) { return NULL; |