mirror of
https://github.com/neovim/neovim.git
synced 2024-12-21 03:35:02 -07:00
Trigger DirChanged on 'autochdir'
This commit is contained in:
parent
30f775f8a6
commit
197f50bf9a
@ -6949,7 +6949,7 @@ void free_cd_dir(void)
|
||||
|
||||
#endif
|
||||
|
||||
static void apply_autocmd_dirchanged(char_u *new_dir, CdScope scope)
|
||||
void apply_autocmd_dirchanged(char_u *new_dir, CdScope scope)
|
||||
{
|
||||
dict_T *dict = get_vim_var_dict(VV_EVENT);
|
||||
char buf[8];
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/file_search.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
#include "nvim/fileio.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/message.h"
|
||||
@ -1531,7 +1532,12 @@ int vim_chdirfile(char_u *fname)
|
||||
|
||||
STRLCPY(dir, fname, MAXPATHL);
|
||||
*path_tail_with_sep(dir) = NUL;
|
||||
return os_chdir((char *)dir) == 0 ? OK : FAIL;
|
||||
if (os_chdir((char *)dir) != 0) {
|
||||
return FAIL;
|
||||
}
|
||||
apply_autocmd_dirchanged(dir, kCdScopeWindow);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/// Change directory to "new_dir". Search 'cdpath' for relative directory names.
|
||||
|
Loading…
Reference in New Issue
Block a user