diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-10-17 22:04:53 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2021-10-17 22:04:53 +0800 |
commit | 60584c0245a55d72422686aa702132814145b0c1 (patch) | |
tree | 0bb558f11c5bd9e5bb0b4a51ea77530899767dd7 /src/nvim/file_search.c | |
parent | 34cfe745681189bbd8ec2543971a49e013bfebf9 (diff) | |
download | rneovim-60584c0245a55d72422686aa702132814145b0c1.tar.gz rneovim-60584c0245a55d72422686aa702132814145b0c1.tar.bz2 rneovim-60584c0245a55d72422686aa702132814145b0c1.zip |
vim-patch:8.2.0909: cannot go back to the previous local directory
Problem: Cannot go back to the previous local directory.
Solution: Add "tcd -" and "lcd -". (Yegappan Lakshmanan, closes vim/vim#4362)
https://github.com/vim/vim/commit/002bc79991286934a9593b80635c27d4238cdfc4
Diffstat (limited to 'src/nvim/file_search.c')
-rw-r--r-- | src/nvim/file_search.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 22c7b35fa9..0922017e2b 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -54,6 +54,7 @@ #include "nvim/eval.h" #include "nvim/file_search.h" #include "nvim/fileio.h" +#include "nvim/globals.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" @@ -1666,11 +1667,12 @@ int vim_chdirfile(char_u *fname, CdCause cause) NameBuff[0] = NUL; } - if (cause != kCdCauseOther && pathcmp(dir, (char *)NameBuff, -1) != 0) { - if (os_chdir(dir) != 0) { - return FAIL; + if (os_chdir(dir) == 0) { + if (cause != kCdCauseOther && pathcmp(dir, (char *)NameBuff, -1) != 0) { + do_autocmd_dirchanged(dir, kCdScopeWindow, cause); } - do_autocmd_dirchanged(dir, kCdScopeWindow, cause); + } else { + return FAIL; } return OK; |