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.
This commit is contained in:
zeertzjq
2024-04-16 20:57:01 +08:00
committed by GitHub
parent 2fc2343728
commit 5cfdaaaeac
5 changed files with 130 additions and 29 deletions

View File

@@ -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++;