From 0c43479979547ed84b2a898dcc7816767333cc80 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sat, 10 Dec 2016 18:33:55 +0900 Subject: vim-patch:7.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 vim/vim#777, closes vim/vim#803) Add test_autochdir() to enable 'acd' before "starting" is reset. https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b --- src/nvim/testdir/test_alot.vim | 1 + src/nvim/testdir/test_autochdir.vim | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/nvim/testdir/test_autochdir.vim (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 818ff7cf54..54a2795d4a 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -3,6 +3,7 @@ source test_assign.vim source test_autocmd.vim +source test_autochdir.vim source test_cursor_func.vim source test_ex_undo.vim source test_expr.vim diff --git a/src/nvim/testdir/test_autochdir.vim b/src/nvim/testdir/test_autochdir.vim new file mode 100644 index 0000000000..f52e2e668a --- /dev/null +++ b/src/nvim/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 -- cgit From 6ba3b8538245d1176b869734c76f2688709cf106 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sat, 10 Dec 2016 18:49:33 +0900 Subject: vim-patch:6f1d9a Updated runtime files. https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176 --- src/nvim/testdir/Makefile | 3 ++- src/nvim/testdir/test_alot.vim | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 84a0c0b889..5bb7fd1dda 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -30,6 +30,7 @@ SCRIPTS := \ # Tests using runtest.vim.vim. # Keep test_alot*.res as the last one, sort the others. NEW_TESTS = \ + test_autochdir.res \ test_bufwintabinfo.res \ test_cmdline.res \ test_cscope.res \ @@ -43,8 +44,8 @@ NEW_TESTS = \ test_quickfix.res \ test_signs.res \ test_syntax.res \ - test_usercommands.res \ test_timers.res \ + test_usercommands.res \ test_viml.res \ test_visual.res \ test_window_id.res \ diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 54a2795d4a..818ff7cf54 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -3,7 +3,6 @@ source test_assign.vim source test_autocmd.vim -source test_autochdir.vim source test_cursor_func.vim source test_ex_undo.vim source test_expr.vim -- cgit From 097c8dcccab1f66098e0096c7590ea4eb446dd56 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 4 Jan 2017 05:22:32 +0100 Subject: refactor: Remove VimL function `test_autochdir()` - Eliminate global test_autochdir. - Eliminate VimL function test_autochdir() - Use a lua test instead. Fails correctly after reverting 0c4347997954 / vim-patch:7.4.2015. --- src/nvim/testdir/Makefile | 1 - src/nvim/testdir/test_autochdir.vim | 17 ----------------- 2 files changed, 18 deletions(-) delete mode 100644 src/nvim/testdir/test_autochdir.vim (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 5bb7fd1dda..612071e2e2 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -30,7 +30,6 @@ SCRIPTS := \ # Tests using runtest.vim.vim. # Keep test_alot*.res as the last one, sort the others. NEW_TESTS = \ - test_autochdir.res \ test_bufwintabinfo.res \ test_cmdline.res \ test_cscope.res \ diff --git a/src/nvim/testdir/test_autochdir.vim b/src/nvim/testdir/test_autochdir.vim deleted file mode 100644 index f52e2e668a..0000000000 --- a/src/nvim/testdir/test_autochdir.vim +++ /dev/null @@ -1,17 +0,0 @@ -" 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 -- cgit