Christian Brabandt wrote:

> On So, 21 Feb 2016, Axel Bender wrote:
> 
> > Yup, at 1379 here.
> 
> Yes, I see the problem. It's caused by having :set acd change to the 
> directory of the first buffer when initializing the options. Later we 
> call fix_arg_enc() which tries to guess the filenames again, butt since 
> 'autochdir' has switched the working directory already, it tries to 
> switch to the directory again, e.g. if the directory src/file1 is given, 
> will try to edit src/src/file1.
> 
> I think a proper fix is to skip changing the directory, if Vim is still
> starting up. It will get done later in edit_buffers() anyhow (and then
> later in win_enter_ext() again), so I think we can safely skip it, which
> is what the following patch does:
> 
> diff -r c3a233d90eca src/buffer.c
> --- a/src/buffer.c      Sun Feb 21 23:15:06 2016 +0100
> +++ b/src/buffer.c      Mon Feb 22 14:37:20 2016 +0100
> @@ -1621,7 +1621,8 @@
>      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

That seems to be a good solution.

-- 
   [SIR LAUNCELOT runs back up the stairs, grabs a rope
   of the wall and swings out over the heads of the CROWD in a
   swashbuckling manner towards a large window.  He stops just short
   of the window and is left swing pathetically back and forth.]
LAUNCELOT: Excuse me ... could somebody give me a push ...
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui