vim-patch:8.0.1459: cannot handle change of directory

Problem:    Cannot handle change of directory.
Solution:   Add the DirChanged autocommand event. (Andy Massimino,
            closes vim/vim#888)  Avoid changing directory for 'autochdir' too often.
b7407d3fc9

Only add "auto" pattern. "window" and "global" are already implemented.
Skip `Test_dirchanged_auto` using `CheckFunction test_autochdir`.
Part of PR #15952. More information can be found there.

N/A patches for version.c:

vim-patch:8.0.1460: missing file in patch

Problem:    Missing file in patch.
Solution:   Add changes to missing file.
b5cb65ba2b

vim-patch:8.0.1461: missing another file in patch

Problem:    Missing another file in patch.
Solution:   Add changes to missing file.
15833239a4
This commit is contained in:
zeertzjq
2021-10-17 22:04:53 +08:00
parent 30af69509d
commit 920473d2f2
9 changed files with 94 additions and 14 deletions

View File

@@ -4542,7 +4542,7 @@ static void win_enter_ext(win_T *const wp, const int flags)
if (os_chdir(new_dir) == 0) {
if (!p_acd && !strequal(new_dir, cwd)) {
do_autocmd_dirchanged(new_dir, curwin->w_localdir
? kCdScopeWindow : kCdScopeTab, true);
? kCdScopeWindow : kCdScopeTab, kCdCauseWindow);
}
shorten_fnames(true);
}
@@ -4551,7 +4551,7 @@ static void win_enter_ext(win_T *const wp, const int flags)
// directory: Change to the global directory.
if (os_chdir((char *)globaldir) == 0) {
if (!p_acd && !strequal((char *)globaldir, cwd)) {
do_autocmd_dirchanged((char *)globaldir, kCdScopeGlobal, true);
do_autocmd_dirchanged((char *)globaldir, kCdScopeGlobal, kCdCauseWindow);
}
}
XFREE_CLEAR(globaldir);