diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-02-11 03:55:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 03:55:32 +0800 |
commit | 38bf52821a2f647f310641bcb82b2d09ba27c2b1 (patch) | |
tree | b66c5d10af42d7a2bcfd91758d75525470a5e72a /src/nvim/api/vim.c | |
parent | 4d59318ecba08e2f9fe5543f442e62af50dbb06d (diff) | |
parent | 23c3f7f572d3a1f3816a9a9ae1b3632c53856923 (diff) | |
download | rneovim-38bf52821a2f647f310641bcb82b2d09ba27c2b1.tar.gz rneovim-38bf52821a2f647f310641bcb82b2d09ba27c2b1.tar.bz2 rneovim-38bf52821a2f647f310641bcb82b2d09ba27c2b1.zip |
Merge pull request #17353 from zeertzjq/api-changedir-func
fix(api): use changedir_func() in nvim_set_current_dir()
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index ada041bab2..f7c55344f5 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -31,6 +31,7 @@ #include "nvim/file_search.h" #include "nvim/fileio.h" #include "nvim/getchar.h" +#include "nvim/globals.h" #include "nvim/highlight.h" #include "nvim/highlight_defs.h" #include "nvim/lua/executor.h" @@ -545,20 +546,19 @@ void nvim_set_current_dir(String dir, Error *err) return; } - char string[MAXPATHL]; + char_u string[MAXPATHL]; memcpy(string, dir.data, dir.size); string[dir.size] = NUL; try_start(); - if (vim_chdir((char_u *)string)) { + if (!changedir_func(string, kCdScopeGlobal)) { if (!try_end(err)) { api_set_error(err, kErrorTypeException, "Failed to change directory"); } return; } - post_chdir(kCdScopeGlobal, true); try_end(err); } |