aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/autocmd.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-16 20:57:01 +0800
committerGitHub <noreply@github.com>2024-04-16 20:57:01 +0800
commit5cfdaaaeac0f53a621696d8eb6b5a3ba90438c98 (patch)
tree8d058733804bed0990c1a8e6836663f7b2460d5d /src/nvim/autocmd.c
parent2fc2343728831d890a043def5d9d714947737cf6 (diff)
downloadrneovim-5cfdaaaeac0f53a621696d8eb6b5a3ba90438c98.tar.gz
rneovim-5cfdaaaeac0f53a621696d8eb6b5a3ba90438c98.tar.bz2
rneovim-5cfdaaaeac0f53a621696d8eb6b5a3ba90438c98.zip
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.
Diffstat (limited to 'src/nvim/autocmd.c')
-rw-r--r--src/nvim/autocmd.c2
1 files changed, 1 insertions, 1 deletions
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++;