MacVim r129 and Xcode

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

MacVim r129 and Xcode

amrox

Awesome work so far on MacVim.

I've ran into a small issue with the latest snapshot.  I have MacVim
set as my editor for source files in Xcode.  In previous versions,
double-clicking on a source file in the Xcode file browser would open
the file in MacVim (as expected).  However in the r129 snapshot, this
doesn't work.  Double-clicking a source file creates a new instance of
MacVim, and this new instance never loads the source file.  In fact I
can't open any buffers at all with the MacVim launched by Xcode.

The easy workaround is to open the files through MacVim instead of
Xcode, but I thought I would bring it to your attention anyway.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: MacVim r129 and Xcode

Björn Winckler

I've ran into a small issue with the latest snapshot.  I have MacVim
set as my editor for source files in Xcode.  In previous versions,
double-clicking on a source file in the Xcode file browser would open
the file in MacVim (as expected).  However in the r129 snapshot, this
doesn't work.  Double-clicking a source file creates a new instance of
MacVim, and this new instance never loads the source file.  In fact I
can't open any buffers at all with the MacVim launched by Xcode.

I never tried using Xcode to open files myself before so I gave it a try now to see if I could reproduce this problem.  For me it works to open files by double-clicking them in Xcode.  However, unless MacVim is already open there is a 3.5 second delay from when i double-click the file to when it actually opens up in MacVim.  Also, if there is no open window in MacVim it brings up an untitled document at the same time.  The same thing happens with r83.

- Do you experience these same problems?
- When you say that you "can't open any buffers at all with the MacVim launched by Xcode", do you mean that MacVim is completely unresponsive, or only that it doesn't respond to you double-clicking files in Xcode?

I'm not sure what Xcode is doing here, but this 3.5 second delay makes me think it launches MacVim and then sits and waits 3.5 seconds before telling it to open a file.  In theory the delegate of NSApp should get a application:openFiles: message when a file is double-clicked in Xcode (this is what happens if you choose "Open with" when you right-click a file in the Finder), but instead it sends applicationOpenUntitledFile: first, and then it sends application:openFiles: message.

Has anybody else any experience with Xcode?  Any ideas as to what is causing this behaviour (i.e. telling MacVim first to open an untitled file and then telling it to open the file the user double-clicked on)?


/Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: MacVim r129 and Xcode

amrox

I think the problem was that I had two MacVims on my machine.  One was
the r129 snapshot, installed in /Applications and the other was an
earlier version that I compiled myself, and still living in my ~/src
dir.  I deleted my self-compiled build and it worked fine.  Xcode
launched MacVim and opened the source file just like I would expect.
I'm fairly (but not completely) sure that I set Xcode to use /
Applications/MacVim.  It seems unlikely, but is it possible that the
two versions were conflicting somehow?

I have not ruled out user error on my part =]

Also, I do see the "3.5 second" delay with MacVim, but only when
MacVim isn't already open.  I also see a similar delay when using the
Carbon GVim and TextMate, so I think this delay only occurs when Xcode
has to launch the external editor itself.

On Aug 14, 6:39 am, "björn" <[hidden email]> wrote:

> > I've ran into a small issue with the latest snapshot.  I have MacVim
> > set as my editor for source files in Xcode.  In previous versions,
> > double-clicking on a source file in the Xcode file browser would open
> > the file in MacVim (as expected).  However in the r129 snapshot, this
> > doesn't work.  Double-clicking a source file creates a new instance of
> > MacVim, and this new instance never loads the source file.  In fact I
> > can't open any buffers at all with the MacVim launched by Xcode.
>
> I never tried using Xcode to open files myself before so I gave it a try now
> to see if I could reproduce this problem.  For me it works to open files by
> double-clicking them in Xcode.  However, unless MacVim is already open there
> is a 3.5 second delay from when i double-click the file to when it actually
> opens up in MacVim.  Also, if there is no open window in MacVim it brings up
> an untitled document at the same time.  The same thing happens with r83.
>
> - Do you experience these same problems?
> - When you say that you "can't open any buffers at all with the MacVim
> launched by Xcode", do you mean that MacVim is completely unresponsive, or
> only that it doesn't respond to you double-clicking files in Xcode?
>
> I'm not sure what Xcode is doing here, but this 3.5 second delay makes me
> think it launches MacVim and then sits and waits 3.5 seconds before telling
> it to open a file.  In theory the delegate of NSApp should get a
> application:openFiles: message when a file is double-clicked in Xcode (this
> is what happens if you choose "Open with" when you right-click a file in the
> Finder), but instead it sends applicationOpenUntitledFile: first, and then
> it sends application:openFiles: message.
>
> Has anybody else any experience with Xcode?  Any ideas as to what is causing
> this behaviour (i.e. telling MacVim first to open an untitled file and then
> telling it to open the file the user double-clicked on)?
>
> /Björn


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: MacVim r129 and Xcode

Björn Winckler


I think the problem was that I had two MacVims on my machine.  One was
the r129 snapshot, installed in /Applications and the other was an
earlier version that I compiled myself, and still living in my ~/src
dir.  I deleted my self-compiled build and it worked fine.  Xcode
launched MacVim and opened the source file just like I would expect.
I'm fairly (but not completely) sure that I set Xcode to use /
Applications/MacVim.  It seems unlikely, but is it possible that the
two versions were conflicting somehow?

I have not ruled out user error on my part =]

Having multiple versions of MacVim.app on my hard drive has caused me a lot of headaches in the past.  To take one bizarre example; I have one MacVim.app in my /Applications folder and then another in build/Debug.  If I rebuild the version in build/Debug and then start the one in /Applications (how doesn't matter, I can double-click on it, start from Terminal, whatever), then it will use the build/Debug executable.  All I can say is: "Beware!"

Also, I do see the "3.5 second" delay with MacVim, but only when
MacVim isn't already open.  I also see a similar delay when using the
Carbon GVim and TextMate, so I think this delay only occurs when Xcode
has to launch the external editor itself.

Thanks, that is good to know. It is a bit annoying that every file you open in Xcode pops up in its own window, the only thing I can do about that is to have a user default that lets you choose whether files opened externally will open in a tab in the topmost window, or if they open in a new window.  Would that be useful?  If so I can try to have it in the next snapshot.


/Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---