Loading ...
Sorry, an error occurred while loading the content.

9910Re: mvim on file with path

Expand Messages
  • Nico Weber
    Feb 4, 2009
      > 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 during
      vim startup chdir() back to that in the child process before calling
      exec(). Any better suggestions?


      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 21 messages in this topic