patch 8.2.3593: directory is wrong after executing "lcd" with win_execute()
Problem: Directory is wrong after executing "lcd" with win_execute().
Solution: Correct the directory when going back to the original window.
(closes #9132)
diff --git a/src/testdir/test_execute_func.vim b/src/testdir/test_execute_func.vim
index 2652ba1..2a84706 100644
--- a/src/testdir/test_execute_func.vim
+++ b/src/testdir/test_execute_func.vim
@@ -105,6 +105,18 @@
call win_gotoid(otherwin)
bwipe!
+
+ " check :lcd in another window does not change directory
+ let curid = win_getid()
+ let curdir = getcwd()
+ split Xother
+ lcd ..
+ " Use :pwd to get the actual current directory
+ let otherdir = execute('pwd')
+ call win_execute(curid, 'lcd testdir')
+ call assert_equal(otherdir, execute('pwd'))
+ bwipe!
+ execute 'cd ' .. curdir
endfunc
func Test_win_execute_update_ruler()