diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2017-01-16 13:36:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-16 13:36:16 +0100 |
commit | 340f79b4b8f1021f4a3b88265ced2ce39d0e2e03 (patch) | |
tree | 71509fab0581f8454272493e38fd0018a32c3c5f /src/nvim/ex_docmd.c | |
parent | fa94c4c2d917b70df443ba0ebcd87da35dc1bb30 (diff) | |
parent | 1f7a119f5efc13fbce6446bf268c2e0f9d753147 (diff) | |
download | rneovim-340f79b4b8f1021f4a3b88265ced2ce39d0e2e03.tar.gz rneovim-340f79b4b8f1021f4a3b88265ced2ce39d0e2e03.tar.bz2 rneovim-340f79b4b8f1021f4a3b88265ced2ce39d0e2e03.zip |
Merge #5928 'New event: DirChanged'
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 5ff79bcfef..e205901635 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6998,8 +6998,6 @@ void post_chdir(CdScope scope) shorten_fnames(TRUE); } - - /// `:cd`, `:tcd`, `:lcd`, `:chdir`, `:tchdir` and `:lchdir`. void ex_cd(exarg_T *eap) { @@ -7041,30 +7039,31 @@ void ex_cd(exarg_T *eap) new_dir = NameBuff; } #endif - if (vim_chdir(new_dir)) { - EMSG(_(e_failed)); - } else { - CdScope scope = kCdScopeGlobal; // Depends on command invoked + CdScope scope = kCdScopeGlobal; // Depends on command invoked - switch (eap->cmdidx) { - case CMD_tcd: - case CMD_tchdir: - scope = kCdScopeTab; - break; - case CMD_lcd: - case CMD_lchdir: - scope = kCdScopeWindow; - break; - default: - break; - } + switch (eap->cmdidx) { + case CMD_tcd: + case CMD_tchdir: + scope = kCdScopeTab; + break; + case CMD_lcd: + case CMD_lchdir: + scope = kCdScopeWindow; + break; + default: + break; + } + if (vim_chdir(new_dir, scope)) { + EMSG(_(e_failed)); + } else { post_chdir(scope); - - /* Echo the new current directory if the command was typed. */ - if (KeyTyped || p_verbose >= 5) + // Echo the new current directory if the command was typed. + if (KeyTyped || p_verbose >= 5) { ex_pwd(eap); + } } + xfree(tofree); } } |