diff options
author | vimboss <devnull@localhost> | 2007-09-29 11:16:17 +0000 |
---|---|---|
committer | vimboss <devnull@localhost> | 2007-09-29 11:16:17 +0000 |
commit | adb8deb03a6cfa1bebdae2f6f0b680d95ac4fba8 (patch) | |
tree | d3f050c88bcd00d98975ffa05692575637d6040c | |
parent | 2dd71587f6e5feaa0970f87de9c163a093dc7f76 (diff) | |
download | vim-7.1.124.tar.gz |
-rw-r--r-- | src/gui_mac.c | 14 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/gui_mac.c b/src/gui_mac.c index bfa3b2a1..adc8ddc1 100644 --- a/src/gui_mac.c +++ b/src/gui_mac.c @@ -1046,6 +1046,7 @@ HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) { int i; char_u *p; + int fnum = -1; /* these are the initial files dropped on the Vim icon */ for (i = 0 ; i < numFiles; i++) @@ -1055,6 +1056,18 @@ HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) mch_exit(2); else alist_add(&global_alist, p, 2); + if (fnum == -1) + fnum = GARGLIST[GARGCOUNT - 1].ae_fnum; + } + + /* If the file name was already in the buffer list we need to switch + * to it. */ + if (curbuf->b_fnum != fnum) + { + char_u cmd[30]; + + vim_snprintf((char *)cmd, 30, "silent %dbuffer", fnum); + do_cmdline_cmd(cmd); } /* Change directory to the location of the first file. */ @@ -2920,7 +2933,6 @@ gui_mch_init(void) /* TODO: Move most of this stuff toward gui_mch_init */ Rect windRect; MenuHandle pomme; - long gestalt_rc; EventTypeSpec eventTypeSpec; EventHandlerRef mouseWheelHandlerRef; #ifdef USE_CARBONKEYHANDLER diff --git a/src/version.c b/src/version.c index 8dcac6be..3a310ad5 100644 --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 124, +/**/ 123, /**/ 122, |