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/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index d9fdc80c60..58ec5dc377 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1330,7 +1330,7 @@ void enter_buffer(buf_T *buf) void do_autochdir(void) { if (p_acd) { - if (starting == 0 + if ((starting == 0 || test_autochdir) && curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK) { shorten_fnames(true); -- cgit