summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-23 16:19:07 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-23 16:19:07 +0100
commit6bd364e08461159ad3c153ffba4def5b896486a1 (patch)
treeaf54a95fcdd46d89c512de0b51dbc823d64ffb44 /src/buffer.c
parent254ebaf068919407de6bd83ac905bd2f36ad944e (diff)
patch 7.4.1401v7.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)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 89dedc58f9..26d77236f7 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1615,11 +1615,14 @@ enter_buffer(buf_T *buf)
#if defined(FEAT_AUTOCHDIR) || defined(PROTO)
/*
* Change to the directory of the current buffer.
+ * Don't do this while still starting up.
*/
void
do_autochdir(void)
{
- if (curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK)
+ if (starting == 0
+ && curbuf->b_ffname != NULL
+ && vim_chdirfile(curbuf->b_ffname) == OK)
shorten_fnames(TRUE);
}
#endif