diff src/if_py_both.h @ 31263:d8e7d725a666 v9.0.0965

patch 9.0.0965: using one window for executing autocommands is insufficient Commit: https://github.com/vim/vim/commit/e76062c078debed0df818f70e4db14ad7a7cb53a Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 28 18:51:43 2022 +0000 patch 9.0.0965: using one window for executing autocommands is insufficient Problem: Using one window for executing autocommands is insufficient. Solution: Use up to five windows for executing autocommands.
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Nov 2022 20:00:05 +0100
parents 684e6dfa2fba
children 25b9669741b2
line wrap: on
line diff
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -5283,8 +5283,11 @@ BufferSetattr(BufferObject *self, char *
 	VimTryStart();
 	// Using aucmd_*: autocommands will be executed by rename_buffer
 	aucmd_prepbuf(&aco, self->buf);
-	ren_ret = rename_buffer(val);
-	aucmd_restbuf(&aco);
+	if (curbuf == self->buf)
+	{
+	    ren_ret = rename_buffer(val);
+	    aucmd_restbuf(&aco);
+	}
 	Py_XDECREF(todecref);
 	if (VimTryEnd())
 	    return -1;