diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-12-16 15:38:02 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-12-16 15:38:02 +0100 |
commit | 2caad3fbbdbf1486a176c9f6bfbc3d9be90e09f7 (patch) | |
tree | f8c0b685281d64e985fd59046f1c12df66ca85bb /src/testdir/test_autochdir.vim | |
parent | 4efe73b478d3ba689078da502fd96f45204ff1f5 (diff) |
patch 8.1.0602: DirChanged is also triggered when directory didn't changev8.1.0602
Problem: DirChanged is also triggered when the directory didn't change.
(Daniel Hahler)
Solution: Compare the current with the new directory. (closes #3697)
Diffstat (limited to 'src/testdir/test_autochdir.vim')
-rw-r--r-- | src/testdir/test_autochdir.vim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/testdir/test_autochdir.vim b/src/testdir/test_autochdir.vim index 05d69631c4..90538fbc09 100644 --- a/src/testdir/test_autochdir.vim +++ b/src/testdir/test_autochdir.vim @@ -8,11 +8,19 @@ func Test_set_filename() let cwd = getcwd() call test_autochdir() set acd + + let s:li = [] + autocmd DirChanged auto call add(s:li, "autocd") + autocmd DirChanged auto call add(s:li, expand("<afile>")) + new w samples/Xtest call assert_equal("Xtest", expand('%')) call assert_equal("samples", substitute(getcwd(), '.*/\(\k*\)', '\1', '')) + call assert_equal(["autocd", getcwd()], s:li) + bwipe! + au! DirChanged set noacd exe 'cd ' . cwd call delete('samples/Xtest') |