4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: GTK GUI: the GTK file dialog can't handle a relative path.
12 Solution: Make the initial directory a full path before passing it to GTK.
13 (James Vega) Also postpone adding the default file name until
14 after setting the directory.
18 *** ../vim-7.0.128/src/gui_gtk.c Tue Aug 29 17:28:56 2006
19 --- src/gui_gtk.c Tue Oct 10 18:16:00 2006
22 title = CONVERT_TO_UTF8(title);
25 ! /* Concatenate "initdir" and "dflt". */
26 if (initdir == NULL || *initdir == NUL)
27 mch_dirname(dirbuf, MAXPATHL);
28 ! else if (STRLEN(initdir) + 2 < MAXPATHL)
29 ! STRCPY(dirbuf, initdir);
32 /* Always need a trailing slash for a directory. */
34 - if (dflt != NULL && *dflt != NUL
35 - && STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL)
36 - STRCAT(dirbuf, dflt);
38 /* If our pointer is currently hidden, then we should show it. */
39 gui_mch_mousehide(FALSE);
41 title = CONVERT_TO_UTF8(title);
44 ! /* GTK has a bug, it only works with an absolute path. */
45 if (initdir == NULL || *initdir == NUL)
46 mch_dirname(dirbuf, MAXPATHL);
47 ! else if (vim_FullName(initdir, dirbuf, MAXPATHL - 2, FALSE) == FAIL)
49 /* Always need a trailing slash for a directory. */
52 /* If our pointer is currently hidden, then we should show it. */
53 gui_mch_mousehide(FALSE);
59 gtk_window_set_title(GTK_WINDOW(gui.filedlg), (const gchar *)title);
61 + /* Concatenate "initdir" and "dflt". */
62 + if (dflt != NULL && *dflt != NUL
63 + && STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL)
64 + STRCAT(dirbuf, dflt);
66 gtk_file_selection_set_filename(GTK_FILE_SELECTION(gui.filedlg),
67 (const gchar *)dirbuf);
68 *** ../vim-7.0.128/src/version.c Tue Oct 10 17:36:50 2006
69 --- src/version.c Tue Oct 10 18:25:11 2006
73 { /* Add new patch number below this line */
79 I'm not familiar with this proof, but I'm aware of a significant
80 following of toddlers who believe that peanut butter is the solution
81 to all of life's problems... -- Tim Hammerquist
83 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
84 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
85 \\\ download, build and distribute -- http://www.A-A-P.org ///
86 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///