aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-11-19 20:07:04 +0800
committerzeertzjq <zeertzjq@outlook.com>2021-11-19 20:07:04 +0800
commit4785cad8ee808d166a9cbc9d7ab5761da70d0563 (patch)
treef757646ccce3ddf29fe77288ddd095c876165f8c /src/nvim/ex_docmd.c
parent0f58ba10e264697e4bb330a17b41cd9a0ceb8b1e (diff)
downloadrneovim-4785cad8ee808d166a9cbc9d7ab5761da70d0563.tar.gz
rneovim-4785cad8ee808d166a9cbc9d7ab5761da70d0563.tar.bz2
rneovim-4785cad8ee808d166a9cbc9d7ab5761da70d0563.zip
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) https://github.com/vim/vim/commit/0526815c15170a5926e1008600ec29d42d8b64c2
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index e622a2a68f..ae868bd1cf 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -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";