summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_autochdir.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-28 13:15:05 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-28 13:15:05 +0000
commit90c317f2246a7fb4bd4e3feb0778b53627bc9fad (patch)
tree0f765598411fe6bab0519ddb7f1ee4daebb80c67 /src/testdir/test_autochdir.vim
parent8b6256f6ec075cca40341e61ebc9f538b4902dd1 (diff)
patch 8.2.3920: restoring directory after using another window is inefficientv8.2.3920
Problem: Restoring directory after using another window is inefficient. Solution: Only restore the directory for win_execute(). Apply 'autochdir' only when needed.
Diffstat (limited to 'src/testdir/test_autochdir.vim')
-rw-r--r--src/testdir/test_autochdir.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_autochdir.vim b/src/testdir/test_autochdir.vim
index 861db7247a..5d367757fc 100644
--- a/src/testdir/test_autochdir.vim
+++ b/src/testdir/test_autochdir.vim
@@ -51,6 +51,26 @@ func Test_set_filename_other_window()
endtry
endfunc
+func Test_acd_win_execute()
+ let cwd = getcwd()
+ set acd
+ call test_autochdir()
+
+ call mkdir('Xfile')
+ let winid = win_getid()
+ new Xfile/file
+ call assert_match('testdir.Xfile$', getcwd())
+ cd ..
+ call assert_match('testdir$', getcwd())
+ call win_execute(winid, 'echo')
+ call assert_match('testdir$', getcwd())
+
+ bwipe!
+ set noacd
+ call chdir(cwd)
+ call delete('Xfile', 'rf')
+endfunc
+
func Test_verbose_pwd()
let cwd = getcwd()
call test_autochdir()