aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2016-12-10 18:33:55 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2017-01-02 10:43:45 +0900
commit0c43479979547ed84b2a898dcc7816767333cc80 (patch)
tree5ba56dc83b674ef81468d909602647d97f3c8ccc /src/nvim/testdir
parentc5f4b92ff93a40ec4e77b78d0576903e7a60eefd (diff)
downloadrneovim-0c43479979547ed84b2a898dcc7816767333cc80.tar.gz
rneovim-0c43479979547ed84b2a898dcc7816767333cc80.tar.bz2
rneovim-0c43479979547ed84b2a898dcc7816767333cc80.zip
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
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_alot.vim1
-rw-r--r--src/nvim/testdir/test_autochdir.vim17
2 files changed, 18 insertions, 0 deletions
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