9928Re: mvim on file with path
- Feb 7, 20092009/2/5 Nico Weber:
>Yes, that must be what is happening.
>> Hmmm...it only happens if MacVim forks; i.e. if you start with "mvim
>> -f path/filename" then everything works fine.
>> Does anybody have any ideas why forking would cause this (Nico,
>> Ben, ...?).
> I haven't tested this, but I guess this is what happens:
> 1.) Vim starts up, parses vimrc (and sets autochdir)
> 2.) Vim changes the current directory because of autochdir
> 3.) Vim forks, which basically kills vim and restarts it as a child
> 4.) The child process inherits the (changed) current directory
> 5.) During child startup, vim tries to open the relative path
> 6.) Since the current directory has changed, the relative path is not
> resolved correctly
> The best fix I can think of is to store the original directory duringThis sounds a bit too hacked together, but the only other solution I
> vim startup chdir() back to that in the child process before calling
> exec(). Any better suggestions?
can think of is to fork earlier.
At the moment (as far as I can understand) we only fork after reading
the rc-files because a user may add "f" to 'guioptions'. Now, my
question is: does anybody really _need_ this functionality? If we
crippled this option we could fork right after parsing the command
line arguments and it would fix the above problems and potentially
others (that we do not yet know about) as well. Another side-effect
of this is that we don't have to perform initializations twice which
would cut down on startup times.
I would be much more comfortable with this solution. Comments?
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
- << Previous post in topic Next post in topic >>