On 2 September 2010 14:16, David Salgado wrote: > > The behaviour change is more subtle than I thought. > > You're right - if I follow your steps exactly, i.e. cd into a > directory and then type "mvim file1" to open the MacVim window to edit > file1, then the working directory stays the same regardless of what > files I drag in from the finder window. > > But, what I usually do is cd into my project directory and just type > "mvim" to open a blank window with the working directory set to the > project root. In that case, when I first do :pwd, the working > directory is the project root. > > Then, as soon as I drag in a file from a different directory, the > working directory changes. In fact, the working directory seems to > lock to the directory containing whichever file is dragged in first. > Subsequent file drag and drops do not change :pwd > > That's the difference from 7.2 - with MacVim 7.2, the working > directory stays at the project root, regardless of what files I drag > in, even if there was no file being edited in the first window. > > Now that I know what's happening, I can work around it by always being > careful to type "mvim somefile" to open MacVim, or just make sure I > drag in a file from the project root before I do anything else. > > Many thanks for taking the time to look into this.
Good, I'm glad you figured it out. This behavior of changing the pwd is a feature and not a bug. If you open a new file (via open panel, by dropping, ...) the pwd is changed if the window is "unused". A windows is classified as "unused" if: 1. only one tab 2. no changes in buffer 3. buffer has no filename associated with it In most cases I think this is what you'd expect, but I can see that it is confusing if you use "mvim" specifically to open a new window in a certain directory. Not sure what to do about this? (I'm open to suggestions.) Björn -- You received this message from the "vim_mac" 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
