From c0de12c3c5f8a19172b4faeda89d01003ae03a71 Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Wed, 27 Apr 2016 15:18:42 -0700 Subject: vim-patch: 7.4.1401 Problem: Having 'autochdir' set during startup and using diff mode doesn't work. (Axel Bender) Solution: Don't use 'autochdir' while still starting up. (Christian Brabandt) https://github.com/vim/vim/commit/6bd364e08461159ad3c153ffba4def5b896486a1 --- src/nvim/buffer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 529d0889bd..6ed5b3136f 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1294,14 +1294,15 @@ void enter_buffer(buf_T *buf) redraw_later(NOT_VALID); } -/* - * Change to the directory of the current buffer. - */ +// Change to the directory of the current buffer. +// Don't do this while still starting up. void do_autochdir(void) { if (p_acd) { - if (curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK) { - shorten_fnames(TRUE); + if (starting == 0 + && curbuf->b_ffname != NULL + && vim_chdirfile(curbuf->b_ffname) == OK) { + shorten_fnames(true); } } } -- cgit