aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-03-20 14:01:22 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-03-22 18:42:16 +0100
commit165ba3e636769c38d67285e1b8ea2966ccb00b30 (patch)
tree06dddf294d07fbb93aea6711dea72e014eba08b7 /src/nvim/ex_cmds.c
parentca853edb6f9ffe1d2e5d4a63bf88e4c3a059f5fb (diff)
downloadrneovim-165ba3e636769c38d67285e1b8ea2966ccb00b30.tar.gz
rneovim-165ba3e636769c38d67285e1b8ea2966ccb00b30.tar.bz2
rneovim-165ba3e636769c38d67285e1b8ea2966ccb00b30.zip
vim-patch:7.4.2324
Problem: Crash when editing a new buffer and BufUnload autocommand wipes out the new buffer. (Norio Takagi) Solution: Don't allow wiping out this buffer. (partly by Hirohito Higashi) Move old style test13 into test_autocmd. Avoid ml_get error when editing a file. https://github.com/vim/vim/commit/e0ab94e7123ca7855f45919114d948ef2bc1e8c3
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 1b83677807..41f97b0cef 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2284,8 +2284,11 @@ 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);
}
@@ -2298,6 +2301,7 @@ int do_ecmd(
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);