diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2017-03-24 18:30:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-24 18:30:35 +0100 |
| commit | 38274051c066ff0a28582aae5c2edf47825d9f57 (patch) | |
| tree | 19fba05c7d751fd3ee9aaa20b6a65675a6001c3e /src/nvim/ex_cmds.c | |
| parent | a62ec4eb989f41ace8e6b7f085349a2bce964d68 (diff) | |
| parent | 7214d0bc846179a862e8d3061d00270a6caa0d7b (diff) | |
| download | rneovim-38274051c066ff0a28582aae5c2edf47825d9f57.tar.gz rneovim-38274051c066ff0a28582aae5c2edf47825d9f57.tar.bz2 rneovim-38274051c066ff0a28582aae5c2edf47825d9f57.zip | |
Merge pull request #6323 from justinmk/vimpatches
Diffstat (limited to 'src/nvim/ex_cmds.c')
| -rw-r--r-- | src/nvim/ex_cmds.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 1b83677807..e368838df7 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -2284,20 +2284,24 @@ int do_ecmd( } else { win_T *the_curwin = curwin; - // Set the w_closing flag to avoid that autocommands close the window. + // Set w_closing to avoid that autocommands close the window. + // Set b_locked for the same reason. the_curwin->w_closing = true; + buf->b_locked++; + if (curbuf == old_curbuf.br_buf) { buf_copy_options(buf, BCO_ENTER); } // Close the link to the current buffer. This will set - // curwin->w_buffer to NULL. + // oldwin->w_buffer to NULL. u_sync(false); close_buffer(oldwin, curbuf, (flags & ECMD_HIDE) || curbuf->terminal ? 0 : DOBUF_UNLOAD, false); the_curwin->w_closing = false; + buf->b_locked--; // autocmds may abort script processing if (aborting() && curwin->w_buffer != NULL) { @@ -2445,11 +2449,6 @@ int do_ecmd( retval = OK; /* - * Reset cursor position, could be used by autocommands. - */ - check_cursor(); - - /* * Check if we are editing the w_arg_idx file in the argument list. */ check_arg_idx(curwin); |