From 1f68a21d66ba8b4cbc7632c8f1ada4be692bd911 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 18 Nov 2021 10:18:55 +0800 Subject: vim-patch:8.2.3593: directory is wrong after executing "lcd" with win_execute() (#16314) Problem: Directory is wrong after executing "lcd" with win_execute(). Solution: Correct the directory when going back to the original window. (closes vim/vim#9132) https://github.com/vim/vim/commit/7f13b24ab6aca808262e68680d8fe5f082670ebd --- src/nvim/testdir/test_execute_func.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nvim/testdir/test_execute_func.vim') diff --git a/src/nvim/testdir/test_execute_func.vim b/src/nvim/testdir/test_execute_func.vim index 15ba894dbe..f2c7da0aa9 100644 --- a/src/nvim/testdir/test_execute_func.vim +++ b/src/nvim/testdir/test_execute_func.vim @@ -107,6 +107,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() -- cgit