diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-11-19 20:07:04 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2021-11-19 20:07:04 +0800 |
commit | 3d504f27a002b3ce6acf75398789a37611b35c44 (patch) | |
tree | 416fd401bf31eb50f601ff3ae2b5dfcc57d215a5 /src/nvim/testdir | |
parent | 54e9cce61274c89e4d8cd80832faecf67724e834 (diff) | |
download | rneovim-3d504f27a002b3ce6acf75398789a37611b35c44.tar.gz rneovim-3d504f27a002b3ce6acf75398789a37611b35c44.tar.bz2 rneovim-3d504f27a002b3ce6acf75398789a37611b35c44.zip |
vim-patch:8.2.3618: getcwd() is unclear about how 'autochdir' is used
Problem: getcwd() is unclear about how 'autochdir' is used.
Solution: Update the help for getcwd(). Without any arguments always return
the actual current directory. (closes vim/vim#9142)
https://github.com/vim/vim/commit/851c7a699ae00bdc14a4db874cf722b7b7393b53
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_cd.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cd.vim b/src/nvim/testdir/test_cd.vim index 0502791c88..57db0a2544 100644 --- a/src/nvim/testdir/test_cd.vim +++ b/src/nvim/testdir/test_cd.vim @@ -233,4 +233,24 @@ func Test_cd_unknown_dir() call delete('Xa', 'rf') endfunc +func Test_getcwd_actual_dir() + CheckFunction test_autochdir + let startdir = getcwd() + call mkdir('Xactual') + call test_autochdir() + set autochdir + edit Xactual/file.txt + call assert_match('testdir.Xactual$', getcwd()) + lcd .. + call assert_match('testdir$', getcwd()) + edit + call assert_match('testdir.Xactual$', getcwd()) + call assert_match('testdir$', getcwd(win_getid())) + + set noautochdir + bwipe! + call chdir(startdir) + call delete('Xactual', 'rf') +endfunc + " vim: shiftwidth=2 sts=2 expandtab |