1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2021-11-14 11:41:31 +00:00
parent 6a950a6007
commit 7f13b24ab6
5 changed files with 58 additions and 30 deletions

View File

@@ -105,6 +105,18 @@ func Test_win_execute()
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()