aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-11-19 20:07:04 +0800
committerzeertzjq <zeertzjq@outlook.com>2021-11-19 20:07:04 +0800
commit0f58ba10e264697e4bb330a17b41cd9a0ceb8b1e (patch)
tree94b8fa70be765d992258217aad3f00d5cb35732c /src/nvim/testdir
parentf71be1f87b40bf863b6cf6b4fbcebffdd3297d88 (diff)
downloadrneovim-0f58ba10e264697e4bb330a17b41cd9a0ceb8b1e.tar.gz
rneovim-0f58ba10e264697e4bb330a17b41cd9a0ceb8b1e.tar.bz2
rneovim-0f58ba10e264697e4bb330a17b41cd9a0ceb8b1e.zip
vim-patch:8.2.3468: problem with :cd when editing file in non-existent directory
Problem: Problem with :cd when editing file in non-existent directory. (Yee Cheng Chin) Solution: Prepend the current directory to get the full path. (closes vim/vim#8903) https://github.com/vim/vim/commit/c6376c798433bcb9ee38a8664299d11454546950
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_cd.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cd.vim b/src/nvim/testdir/test_cd.vim
index 0bba321ee2..0502791c88 100644
--- a/src/nvim/testdir/test_cd.vim
+++ b/src/nvim/testdir/test_cd.vim
@@ -215,3 +215,22 @@ func Test_cd_from_non_existing_dir()
cd -
call assert_equal(saveddir, getcwd())
endfunc
+
+func Test_cd_unknown_dir()
+ call mkdir('Xa')
+ cd Xa
+ call writefile(['text'], 'Xb.txt')
+ edit Xa/Xb.txt
+ let first_buf = bufnr()
+ cd ..
+ edit
+ call assert_equal(first_buf, bufnr())
+ edit Xa/Xb.txt
+ call assert_notequal(first_buf, bufnr())
+
+ bwipe!
+ exe "bwipe! " .. first_buf
+ call delete('Xa', 'rf')
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab