diff options
author | Richard Doty <richard.a.doty@gmail.com> | 2021-12-29 14:39:08 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-29 14:39:08 +0000 |
commit | 3d0abad5bf4fe125e219f1b56c4e8200cb900e2a (patch) | |
tree | f10f9bde115165002eb54daec16909c0b5ed2cfc /src/testdir/test_cd.vim | |
parent | 264d3ddac0f9474816c20a0e92014d6f7f4b08ac (diff) |
patch 8.2.3933: after ":cd" fails ":cd -" is incorrectv8.2.3933
Problem: After ":cd" fails ":cd -" is incorrect.
Solution: Set the previous directory only after successfully changing
directory. (Richard Doty, closes #9419, closes #8983)
Diffstat (limited to 'src/testdir/test_cd.vim')
-rw-r--r-- | src/testdir/test_cd.vim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/testdir/test_cd.vim b/src/testdir/test_cd.vim index 566e9f6ba6..c2217c944b 100644 --- a/src/testdir/test_cd.vim +++ b/src/testdir/test_cd.vim @@ -44,6 +44,13 @@ func Test_cd_minus() cd - call assert_equal(path, getcwd()) + " Test for :cd - after a failed :cd + call assert_fails('cd /nonexistent', 'E344:') + call assert_equal(path, getcwd()) + cd - + call assert_equal(path_dotdot, getcwd()) + cd - + " Test for :cd - without a previous directory let lines =<< trim [SCRIPT] call assert_fails('cd -', 'E186:') |