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

1430Re: Mac-VIM doesn't cooperate with Finder

Expand Messages
  • Eckehard Berns
    Feb 6, 2004
      > The .vimrc is sourced before the GUI window is opened (because it may
      > specify how it is to be opened). Errors that occur here should be
      > reported in a separate popup window, unless there is a terminal where
      > they can be seen. There already is code to collect the messages and
      > show them in a popup window (for Win32).

      I will have a look at that and see if I can adopt this for Mac OS X also.

      > This delay was added long ago, I think for the X11 GUI. It avoids that
      > the GUI window appears and is then redrawn, that causes a bit of
      > flashing and looks ugly. I can't say I understand why a short delay
      > would cause trouble for the Mac GUI, thus if this helps there should be
      > an explanation why it needs to be different for the Mac.

      The problem here is, that Mac OS X behaves completely different from X11
      and Windows based systems when starting an GUI Application with some
      files which have been dropped on the application icon (or that have been
      double clicked). Instead of adding arguments to the command line the app
      will be started and send AppleEvent messages to open these files. So
      when you drag a file onto the Vim app, it starts without any arguments.
      As soon as you call gui_wait_for_chars(), gui_mac.c will call
      WaitNextEvent(), which will receive the AppleEvent that tells Vim to
      open the dropped file(s). The callback will collect the files and send
      them to Vim via handle_drop(). This again results in output of the
      fileinfo, which sets msg_didany. msg_didany is resposible for the "hit
      ENTER" prompt further down in main.c (I can't lookup actual line numbers
      and the correct function names at the moment). If you skip the GUI
      delay, this event will not be received before the wait_enter() call and
      thus will not force a "hit ENTER" prompt. The AppleEvent will be handled
      like an ordinary file drop, which is ok.

      Maybe a comment stating that the Mac GUI would receive a file drop which
      disturbs the output slightly would be sufficient?

      Eckehard Berns
    • Show all 22 messages in this topic