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

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

Expand Messages
  • Eckehard Berns
    Feb 6, 2004
      > I think I understand the issue. I have three suggestions:
      > 1. Remove the delay in main(), since it is not needed.
      > 2. Add a mechanism to avoid accepting events before Vim has finished
      > starting up. The current issue with the explicit delay is just one
      > situation where events might be waited for. If someone adds a
      > strange thing in his vimrc then the same problem might popup again.
      > The "starting" variable can be used for this.
      > One catch: If something interactive is to be done (e.g., from a
      > plugin that runs an external command) you are stuck, since you
      > probably can't handle user input before accepting the apple events
      > for the drop. A solution would be to store the drop request and
      > handle it after startup has finished. That's a bit complicated,
      > hopefully we don't really need this.

      I thought about storing open document events for later use, but I don't
      know all consequences of this yet. And I can't use gui.starting since
      it's already reset to false and gui.in_use is true when the GUI delay is
      executed. Or did you refer to another "starting"?

      Hmmm, I think I understand your point. Things might get really
      complicated when there are plugins that might snap in because of
      something in the viminfo file. If I remember the sources correctly
      viminfo is parsed after the GUI has been fired up and thus there could
      be output in the GUI window. The .vimrc file shouldn't be a problem
      since it is run when the GUI isn't used for output yet.

      I think I will try my luck on this approach and try to hold back the
      dropped files until the gui is fully started. In the long run this seems
      to be the cleanest approach.

      > 3. If you don't want the hit-enter prompt for the dropped files, check
      > what happens in gui_handle_drop(). I don't get a prompt on Win32,
      > thus I wonder why Mac would be different.

      I might have expressed myself a bit unclear, but the handle_drop() (we
      can't really use gui_handle_drop() since we don't get actual mouse
      coordinates and would have to make up values for x, y, and modifiers)
      works fine once the application is fully started. So any subsequent
      drops on the app icon in the Dock will work fine and won't show a prompt.

      Eckehard Berns
    • Show all 22 messages in this topic