vim-patch:8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied

Problem:    ":verbose pwd" does not mention 'autochdir' was applied.
Solution:   Remember the last chdir was done by 'autochdir'.  (issue vim/vim#9142)
0526815c15
This commit is contained in:
zeertzjq
2021-11-19 20:07:04 +08:00
parent 0f58ba10e2
commit 4785cad8ee
6 changed files with 65 additions and 4 deletions

View File

@@ -7753,6 +7753,7 @@ void post_chdir(CdScope scope, bool trigger_dirchanged)
abort();
}
last_chdir_reason = NULL;
shorten_fnames(true);
if (trigger_dirchanged) {
@@ -7870,7 +7871,9 @@ static void ex_pwd(exarg_T *eap)
#endif
if (p_verbose > 0) {
char *context = "global";
if (curwin->w_localdir != NULL) {
if (last_chdir_reason != NULL) {
context = last_chdir_reason;
} else if (curwin->w_localdir != NULL) {
context = "window";
} else if (curtab->tp_localdir != NULL) {
context = "tabpage";