diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-01 16:26:19 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-01 16:26:19 +0200 |
commit | 950587242cad52d067a15f0f0c83528a28f75731 (patch) | |
tree | ff69b30a48c1bca712733f8ad48944d79de2e74e /src/ex_docmd.c | |
parent | 6c9ba0428041d5316871245be38c13faa0107026 (diff) |
patch 8.2.0876: :pwd does not give a hint about the scope of the directoryv8.2.0876
Problem: :pwd does not give a hint about the scope of the directory
Solution: Make ":verbose pwd" show the scope. (Takuya Fujiwara, closes #5469)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 7b53e6c6a6..ea2763e442 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -6619,9 +6619,10 @@ post_chdir(cdscope_T scope) /* * Change directory function used by :cd/:tcd/:lcd Ex commands and the - * chdir() function. If 'winlocaldir' is TRUE, then changes the window-local - * directory. If 'tablocaldir' is TRUE, then changes the tab-local directory. - * Otherwise changes the global directory. + * chdir() function. + * scope == CDSCOPE_WINDOW: changes the window-local directory + * scope == CDSCOPE_TABPAGE: changes the tab-local directory + * Otherwise: changes the global directory * Returns TRUE if the directory is successfully changed. */ int @@ -6751,7 +6752,18 @@ ex_pwd(exarg_T *eap UNUSED) #ifdef BACKSLASH_IN_FILENAME slash_adjust(NameBuff); #endif - msg((char *)NameBuff); + if (p_verbose > 0) + { + char *context = "global"; + + if (curwin->w_localdir != NULL) + context = "window"; + else if (curtab->tp_localdir != NULL) + context = "tabpage"; + smsg("[%s] %s", context, (char *)NameBuff); + } + else + msg((char *)NameBuff); } else emsg(_("E187: Unknown")); |