Fix a issue to add duplicate entries into file list
commitbc73e992853cda4d46924b7f56d29c5aec8e0aff
authorJjgod Jiang <gzjjgod@gmail.com>
Thu, 14 Aug 2008 15:55:43 +0000 (14 23:55 +0800)
committerJjgod Jiang <gzjjgod@gmail.com>
Thu, 16 Apr 2009 01:57:24 +0000 (16 09:57 +0800)
tree51e0dcad1c8e8e2b66c787c5859e03152c647742
parentf37f0cd58bb757f4e153ac2201cb218ad81abbf7
Fix a issue to add duplicate entries into file list

vim-cocoa can be launched from (at least) two different
places: command line (Vim -g) or Finder/Dock.

We're expected to open files dropped on to vim-cocoa's
icon, so we implemented application:openFiles: in our
app controller, however, I didn't expected that method
can also be called when vim-cocoa is launched from
command line, thus will cause the same entry be added
into file list twice (one by vim command line handling
itself, another by application:openFiles:).

So, this patch basically checks if the same entry exists
in the "to-open" list (global_alist) before add it on
to that list at application:openFiles:. In this way,
we can safely avoid duplicate entries.

This bug is triggered by the '-d' option. (Issue 23)
src/gui_mac.m