diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-07-09 23:40:45 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-07-09 23:40:45 +0200 |
commit | 5c71994f4ee5f87d4cce990dbc9684c70b1e108b (patch) | |
tree | 54d709f577451315f508421842acd40c5d8776f1 /src/testdir/test_autochdir.vim | |
parent | 32b808a4bdf35b0dea63c735702a591e5869fecd (diff) | |
download | vim-git-5c71994f4ee5f87d4cce990dbc9684c70b1e108b.tar.gz |
patch 7.4.2015v7.4.2015
Problem: When a file gets a name when writing it 'acd' is not effective.
(Dan Church)
Solution: Invoke DO_AUTOCHDIR after writing the file. (Allen Haim, closes
#777, closes #803) Add test_autochdir() to enable 'acd' before
"starting" is reset.
Diffstat (limited to 'src/testdir/test_autochdir.vim')
-rw-r--r-- | src/testdir/test_autochdir.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_autochdir.vim b/src/testdir/test_autochdir.vim new file mode 100644 index 000000000..f52e2e668 --- /dev/null +++ b/src/testdir/test_autochdir.vim @@ -0,0 +1,17 @@ +" Test 'autochdir' behavior + +if !exists("+autochdir") + finish +endif + +func Test_set_filename() + call test_autochdir() + set acd + new + w samples/Xtest + call assert_equal("Xtest", expand('%')) + call assert_equal("samples", substitute(getcwd(), '.*/\(\k*\)', '\1', '')) + bwipe! + set noacd + call delete('samples/Xtest') +endfunc |