comparison src/ex_docmd.c @ 26171:fa8161b003f6 v8.2.3617

patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied Commit: https://github.com/vim/vim/commit/0526815c15170a5926e1008600ec29d42d8b64c2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 18 18:53:45 2021 +0000 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 https://github.com/vim/vim/issues/9142)
author Bram Moolenaar <Bram@vim.org>
date Thu, 18 Nov 2021 20:00:06 +0100
parents e353ace59e62
children 027c5b4b6f07
comparison
equal deleted inserted replaced
26170:3e5f506a2165 26171:fa8161b003f6
7388 7388
7389 post_chdir(scope); 7389 post_chdir(scope);
7390 7390
7391 if (dir_differs) 7391 if (dir_differs)
7392 { 7392 {
7393 last_chdir_reason = NULL;
7393 if (scope == CDSCOPE_WINDOW) 7394 if (scope == CDSCOPE_WINDOW)
7394 acmd_fname = (char_u *)"window"; 7395 acmd_fname = (char_u *)"window";
7395 else if (scope == CDSCOPE_TABPAGE) 7396 else if (scope == CDSCOPE_TABPAGE)
7396 acmd_fname = (char_u *)"tabpage"; 7397 acmd_fname = (char_u *)"tabpage";
7397 else 7398 else
7451 #endif 7452 #endif
7452 if (p_verbose > 0) 7453 if (p_verbose > 0)
7453 { 7454 {
7454 char *context = "global"; 7455 char *context = "global";
7455 7456
7456 if (curwin->w_localdir != NULL) 7457 if (last_chdir_reason != NULL)
7458 context = last_chdir_reason;
7459 else if (curwin->w_localdir != NULL)
7457 context = "window"; 7460 context = "window";
7458 else if (curtab->tp_localdir != NULL) 7461 else if (curtab->tp_localdir != NULL)
7459 context = "tabpage"; 7462 context = "tabpage";
7460 smsg("[%s] %s", context, (char *)NameBuff); 7463 smsg("[%s] %s", context, (char *)NameBuff);
7461 } 7464 }