Patch 8.2.4513
Problem:    Window-local directory is not applied if 'acd' fails.
Solution:   Don't call do_autochdir(). (closes #9891)
Files:      src/window.c, src/testdir/test_autochdir.vim


*** ../vim-8.2.4512/src/window.c        2022-02-24 12:33:13.151233722 +0000
--- src/window.c        2022-03-05 16:56:30.857807710 +0000
***************
*** 4772,4782 ****
      static void
  fix_current_dir(void)
  {
- #ifdef FEAT_AUTOCHDIR
-     if (p_acd)
-       do_autochdir();
-     else
- #endif
      if (curwin->w_localdir != NULL || curtab->tp_localdir != NULL)
      {
        char_u  *dirname;
--- 4772,4777 ----
*** ../vim-8.2.4512/src/testdir/test_autochdir.vim      2022-02-19 
14:49:48.063417489 +0000
--- src/testdir/test_autochdir.vim      2022-03-05 16:56:30.857807710 +0000
***************
*** 86,107 ****
    set acd
    wincmd w
    call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
-   execute 'lcd' cwd
-   call assert_match('\[window\].*testdir$', execute('verbose pwd'))
    execute 'tcd' cwd
    call assert_match('\[tabpage\].*testdir$', execute('verbose pwd'))
    execute 'cd' cwd
    call assert_match('\[global\].*testdir$', execute('verbose pwd'))
    edit
    call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
    wincmd w
    call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose 
pwd'))
    set noacd
    call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose 
pwd'))
    wincmd w
!   call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose 
pwd'))
    execute 'cd' cwd
!   call assert_match('\[global\].*testdir', execute('verbose pwd'))
    wincmd w
    call assert_match('\[window\].*testdir[/\\]Xautodir', execute('verbose 
pwd'))
  
--- 86,112 ----
    set acd
    wincmd w
    call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
    execute 'tcd' cwd
    call assert_match('\[tabpage\].*testdir$', execute('verbose pwd'))
    execute 'cd' cwd
    call assert_match('\[global\].*testdir$', execute('verbose pwd'))
+   execute 'lcd' cwd
+   call assert_match('\[window\].*testdir$', execute('verbose pwd'))
    edit
    call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
+   enew
+   wincmd w
+   call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose 
pwd'))
+   wincmd w
+   call assert_match('\[window\].*testdir$', execute('verbose pwd'))
    wincmd w
    call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose 
pwd'))
    set noacd
    call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose 
pwd'))
    wincmd w
!   call assert_match('\[window\].*testdir$', execute('verbose pwd'))
    execute 'cd' cwd
!   call assert_match('\[global\].*testdir$', execute('verbose pwd'))
    wincmd w
    call assert_match('\[window\].*testdir[/\\]Xautodir', execute('verbose 
pwd'))
  
*** ../vim-8.2.4512/src/version.c       2022-03-05 14:35:07.319171786 +0000
--- src/version.c       2022-03-05 16:58:11.077628035 +0000
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     4513,
  /**/

-- 
If Microsoft would build a car...
... the oil, water temperature, and alternator warning lights would
all be replaced by a single "General Protection Fault" warning light.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220305170106.730881C1EA5%40moolenaar.net.

Raspunde prin e-mail lui