diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2019-04-13 12:50:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-13 12:50:36 +0200 |
commit | 5f996e36d102beeb76848021fe0ded5107c8f24d (patch) | |
tree | 27da72da722367d870bb4aecdf4deeab60664c44 /src/nvim/ex_docmd.c | |
parent | d08692a8246039b938b5645a6c01b4ff7f51671e (diff) | |
download | rneovim-5f996e36d102beeb76848021fe0ded5107c8f24d.tar.gz rneovim-5f996e36d102beeb76848021fe0ded5107c8f24d.tar.bz2 rneovim-5f996e36d102beeb76848021fe0ded5107c8f24d.zip |
options: properly reset directories on 'autochdir' (#9894)
Fixes https://github.com/neovim/neovim/issues/9892
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 037b5dec7f..895fbcd95e 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -7241,7 +7241,7 @@ void free_cd_dir(void) /// Deal with the side effects of changing the current directory. /// /// @param scope Scope of the function call (global, tab or window). -void post_chdir(CdScope scope) +void post_chdir(CdScope scope, bool trigger_dirchanged) { // Always overwrite the window-local CWD. xfree(curwin->w_localdir); @@ -7281,7 +7281,10 @@ void post_chdir(CdScope scope) } shorten_fnames(true); - do_autocmd_dirchanged(cwd, scope); + + if (trigger_dirchanged) { + do_autocmd_dirchanged(cwd, scope); + } } /// `:cd`, `:tcd`, `:lcd`, `:chdir`, `:tchdir` and `:lchdir`. @@ -7343,7 +7346,7 @@ void ex_cd(exarg_T *eap) if (vim_chdir(new_dir, scope)) { EMSG(_(e_failed)); } else { - post_chdir(scope); + post_chdir(scope, true); // Echo the new current directory if the command was typed. if (KeyTyped || p_verbose >= 5) { ex_pwd(eap); |