Mercurial > vim
diff src/testdir/test_cd.vim @ 25868:bcf55847d2ed v8.2.3468
patch 8.2.3468: problem with :cd when editing file in non-existent directory
Commit: https://github.com/vim/vim/commit/c6376c798433bcb9ee38a8664299d11454546950
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 3 19:29:48 2021 +0100
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 #8903)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 03 Oct 2021 20:30:03 +0200 |
parents | da0e5ff44b14 |
children | 460790b520dd |
line wrap: on
line diff
--- a/src/testdir/test_cd.vim +++ b/src/testdir/test_cd.vim @@ -208,4 +208,21 @@ func Test_cd_completion() call delete('XComplFile') 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