lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
8789c3f
To: vim-dev@vim.org
8789c3f
Subject: Patch 7.0.129
8789c3f
Fcc: outbox
8789c3f
From: Bram Moolenaar <Bram@moolenaar.net>
8789c3f
Mime-Version: 1.0
8789c3f
Content-Type: text/plain; charset=ISO-8859-1
8789c3f
Content-Transfer-Encoding: 8bit
8789c3f
------------
8789c3f
8789c3f
Patch 7.0.129
8789c3f
Problem:    GTK GUI: the GTK file dialog can't handle a relative path.
8789c3f
Solution:   Make the initial directory a full path before passing it to GTK.
8789c3f
	    (James Vega)  Also postpone adding the default file name until
8789c3f
	    after setting the directory.
8789c3f
Files:	    src/gui_gtk.c
8789c3f
8789c3f
8789c3f
*** ../vim-7.0.128/src/gui_gtk.c	Tue Aug 29 17:28:56 2006
8789c3f
--- src/gui_gtk.c	Tue Oct 10 18:16:00 2006
8789c3f
***************
8789c3f
*** 1275,1292 ****
8789c3f
      title = CONVERT_TO_UTF8(title);
8789c3f
  # endif
8789c3f
  
8789c3f
!     /* Concatenate "initdir" and "dflt". */
8789c3f
      if (initdir == NULL || *initdir == NUL)
8789c3f
  	mch_dirname(dirbuf, MAXPATHL);
8789c3f
!     else if (STRLEN(initdir) + 2 < MAXPATHL)
8789c3f
! 	STRCPY(dirbuf, initdir);
8789c3f
!     else
8789c3f
  	dirbuf[0] = NUL;
8789c3f
      /* Always need a trailing slash for a directory. */
8789c3f
      add_pathsep(dirbuf);
8789c3f
-     if (dflt != NULL && *dflt != NUL
8789c3f
- 			      && STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL)
8789c3f
- 	STRCAT(dirbuf, dflt);
8789c3f
  
8789c3f
      /* If our pointer is currently hidden, then we should show it. */
8789c3f
      gui_mch_mousehide(FALSE);
8789c3f
--- 1275,1287 ----
8789c3f
      title = CONVERT_TO_UTF8(title);
8789c3f
  # endif
8789c3f
  
8789c3f
!     /* GTK has a bug, it only works with an absolute path. */
8789c3f
      if (initdir == NULL || *initdir == NUL)
8789c3f
  	mch_dirname(dirbuf, MAXPATHL);
8789c3f
!     else if (vim_FullName(initdir, dirbuf, MAXPATHL - 2, FALSE) == FAIL)
8789c3f
  	dirbuf[0] = NUL;
8789c3f
      /* Always need a trailing slash for a directory. */
8789c3f
      add_pathsep(dirbuf);
8789c3f
  
8789c3f
      /* If our pointer is currently hidden, then we should show it. */
8789c3f
      gui_mch_mousehide(FALSE);
8789c3f
***************
8789c3f
*** 1340,1345 ****
8789c3f
--- 1335,1345 ----
8789c3f
      }
8789c3f
      else
8789c3f
  	gtk_window_set_title(GTK_WINDOW(gui.filedlg), (const gchar *)title);
8789c3f
+ 
8789c3f
+     /* Concatenate "initdir" and "dflt". */
8789c3f
+     if (dflt != NULL && *dflt != NUL
8789c3f
+ 			      && STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL)
8789c3f
+ 	STRCAT(dirbuf, dflt);
8789c3f
  
8789c3f
      gtk_file_selection_set_filename(GTK_FILE_SELECTION(gui.filedlg),
8789c3f
  						      (const gchar *)dirbuf);
8789c3f
*** ../vim-7.0.128/src/version.c	Tue Oct 10 17:36:50 2006
8789c3f
--- src/version.c	Tue Oct 10 18:25:11 2006
8789c3f
***************
8789c3f
*** 668,669 ****
8789c3f
--- 668,671 ----
8789c3f
  {   /* Add new patch number below this line */
8789c3f
+ /**/
8789c3f
+     129,
8789c3f
  /**/
8789c3f
8789c3f
-- 
8789c3f
I'm not familiar with this proof, but I'm aware of a significant
8789c3f
following of toddlers who believe that peanut butter is the solution
8789c3f
to all of life's problems... 		-- Tim Hammerquist
8789c3f
8789c3f
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8789c3f
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8789c3f
\\\        download, build and distribute -- http://www.A-A-P.org        ///
8789c3f
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///