Blob Blame History Raw
To: vim-dev@vim.org
Subject: patch 7.1.124
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.1.124 (extra)
Problem:    Mac: When dropping a file on Vim.app that is already in the buffer
	    list (from .viminfo) results in editing an empty, unnamed buffer.
	    (Axel Kielhorn)  Also: warning for unused variable.
Solution:   Move to the buffer of the first agument.  Delete unused variable.
Files:	    src/gui_mac.c


*** ../vim-7.1.123/src/gui_mac.c	Thu Aug 30 12:50:00 2007
--- src/gui_mac.c	Sat Sep 29 13:12:26 2007
***************
*** 1046,1051 ****
--- 1046,1052 ----
      {
  	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,1060 ****
--- 1056,1073 ----
  		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,2926 ****
      /* TODO: Move most of this stuff toward gui_mch_init */
      Rect	windRect;
      MenuHandle	pomme;
-     long	gestalt_rc;
      EventTypeSpec   eventTypeSpec;
      EventHandlerRef mouseWheelHandlerRef;
  #ifdef USE_CARBONKEYHANDLER
--- 2933,2938 ----
*** ../vim-7.1.123/src/version.c	Wed Sep 26 22:35:06 2007
--- src/version.c	Sat Sep 29 13:13:16 2007
***************
*** 668,669 ****
--- 668,671 ----
  {   /* Add new patch number below this line */
+ /**/
+     124,
  /**/

-- 
ERIC IDLE PLAYED: THE DEAD COLLECTOR, MR BINT (A VILLAGE NE'ER-DO -WELL VERY
                  KEEN ON BURNING WITCHES), SIR ROBIN, THE GUARD WHO DOESN'T
                  HICOUGH BUT TRIES TO GET THINGS STRAIGHT, CONCORDE (SIR
                  LAUNCELOT'S TRUSTY STEED), ROGER THE SHRUBBER (A SHRUBBER),
                  BROTHER MAYNARD
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///