From 5cfdaaaeac0f53a621696d8eb6b5a3ba90438c98 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 16 Apr 2024 20:57:01 +0800 Subject: fix(api): ignore 'autochdir' when renaming other buf (#28376) Problem: Renaming non-current buffer changes working directory when 'autochdir' is set. Solution: Temporarily disable 'autochdir'. Add more tests for the win_set_buf change. --- src/nvim/autocmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/autocmd.c') diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index e9db4abf9b..c5d81d4cd2 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -1340,7 +1340,7 @@ void aucmd_prepbuf(aco_save_T *aco, buf_T *buf) win_config_float(auc_win, auc_win->w_config); } // Prevent chdir() call in win_enter_ext(), through do_autochdir() - int save_acd = p_acd; + const int save_acd = p_acd; p_acd = false; // no redrawing and don't set the window title RedrawingDisabled++; -- cgit