aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-11-18 10:18:55 +0800
committerGitHub <noreply@github.com>2021-11-17 21:18:55 -0500
commit1f68a21d66ba8b4cbc7632c8f1ada4be692bd911 (patch)
treed35de0e772ca9e22700569eff43809decb3dcbd1 /src/nvim/testdir
parentdba3590a0e216943392b359d12000393a528be72 (diff)
downloadrneovim-1f68a21d66ba8b4cbc7632c8f1ada4be692bd911.tar.gz
rneovim-1f68a21d66ba8b4cbc7632c8f1ada4be692bd911.tar.bz2
rneovim-1f68a21d66ba8b4cbc7632c8f1ada4be692bd911.zip
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
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_execute_func.vim12
1 files changed, 12 insertions, 0 deletions
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()