home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.209 < prev    next >
Encoding:
Internet Message Format  |  2002-02-10  |  19.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.209
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.209
  11. Problem:    GUI GTK: After selecting a 'guifont' with the font dialog there
  12.         are redraw problems for multi-byte characters.
  13. Solution:   Separate the font dialog from setting the new font name to avoid
  14.         that "*" is used to find wide and bold fonts.
  15.         When redrawing extra characters for the bold trick, take care of
  16.         UTF-8 characters.
  17. Files:        src/gui.c, src/gui_gtk_x11.c, src/option.c, src/proto/gui.pro,
  18.         src/proto/gui_gtk_x11.pro
  19.  
  20.  
  21. *** ../vim60.208/src/gui.c    Tue Feb  5 21:59:55 2002
  22. --- src/gui.c    Mon Feb 11 11:51:53 2002
  23. ***************
  24. *** 19,25 ****
  25.   static void gui_check_pos __ARGS((void));
  26.   static void gui_position_components __ARGS((int));
  27.   static void gui_outstr __ARGS((char_u *, int));
  28. ! static void gui_screenchar __ARGS((int off, int flags, guicolor_T fg, guicolor_T bg, int back));
  29.   static void gui_delete_lines __ARGS((int row, int count));
  30.   static void gui_insert_lines __ARGS((int row, int count));
  31.   static void gui_do_scrollbar __ARGS((win_T *wp, int which, int enable));
  32. --- 19,25 ----
  33.   static void gui_check_pos __ARGS((void));
  34.   static void gui_position_components __ARGS((int));
  35.   static void gui_outstr __ARGS((char_u *, int));
  36. ! static int gui_screenchar __ARGS((int off, int flags, guicolor_T fg, guicolor_T bg, int back));
  37.   static void gui_delete_lines __ARGS((int row, int count));
  38.   static void gui_insert_lines __ARGS((int row, int count));
  39.   static void gui_do_scrollbar __ARGS((win_T *wp, int which, int enable));
  40. ***************
  41. *** 909,919 ****
  42.           gui.highlight_mask = (cattr | attr);
  43.   #ifdef FEAT_HANGULIN
  44.           if (composing_hangul)
  45. !         gui_outstr_nowrap(composing_hangul_buffer, 2,
  46.               GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR, cfg, cbg, 0);
  47.           else
  48.   #endif
  49. !         gui_screenchar(LineOffset[gui.row] + gui.col,
  50.               GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR, cfg, cbg, 0);
  51.       }
  52.       else
  53. --- 909,919 ----
  54.           gui.highlight_mask = (cattr | attr);
  55.   #ifdef FEAT_HANGULIN
  56.           if (composing_hangul)
  57. !         (void)gui_outstr_nowrap(composing_hangul_buffer, 2,
  58.               GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR, cfg, cbg, 0);
  59.           else
  60.   #endif
  61. !         (void)gui_screenchar(LineOffset[gui.row] + gui.col,
  62.               GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR, cfg, cbg, 0);
  63.       }
  64.       else
  65. ***************
  66. *** 942,948 ****
  67.   
  68.   #ifndef FEAT_GUI_MSWIN        /* doesn't seem to work for MSWindows */
  69.           gui.highlight_mask = ScreenAttrs[LineOffset[gui.row] + gui.col];
  70. !         gui_screenchar(LineOffset[gui.row] + gui.col,
  71.               GUI_MON_TRS_CURSOR | GUI_MON_NOCLEAR,
  72.               (guicolor_T)0, (guicolor_T)0, 0);
  73.   #endif
  74. --- 942,948 ----
  75.   
  76.   #ifndef FEAT_GUI_MSWIN        /* doesn't seem to work for MSWindows */
  77.           gui.highlight_mask = ScreenAttrs[LineOffset[gui.row] + gui.col];
  78. !         (void)gui_screenchar(LineOffset[gui.row] + gui.col,
  79.               GUI_MON_TRS_CURSOR | GUI_MON_NOCLEAR,
  80.               (guicolor_T)0, (guicolor_T)0, 0);
  81.   #endif
  82. ***************
  83. *** 1627,1639 ****
  84.       else
  85.           this_len = len;
  86.   
  87. !     gui_outstr_nowrap(s, this_len, 0, (guicolor_T)0, (guicolor_T)0, 0);
  88.       s += this_len;
  89.       len -= this_len;
  90.   #ifdef FEAT_MBYTE
  91.       /* fill up for a double-width char that doesn't fit. */
  92.       if (len > 0 && gui.col < Columns)
  93. !         gui_outstr_nowrap((char_u *)" ", 1,
  94.                         0, (guicolor_T)0, (guicolor_T)0, 0);
  95.   #endif
  96.       /* The cursor may wrap to the next line. */
  97. --- 1627,1640 ----
  98.       else
  99.           this_len = len;
  100.   
  101. !     (void)gui_outstr_nowrap(s, this_len,
  102. !                       0, (guicolor_T)0, (guicolor_T)0, 0);
  103.       s += this_len;
  104.       len -= this_len;
  105.   #ifdef FEAT_MBYTE
  106.       /* fill up for a double-width char that doesn't fit. */
  107.       if (len > 0 && gui.col < Columns)
  108. !         (void)gui_outstr_nowrap((char_u *)" ", 1,
  109.                         0, (guicolor_T)0, (guicolor_T)0, 0);
  110.   #endif
  111.       /* The cursor may wrap to the next line. */
  112. ***************
  113. *** 1648,1655 ****
  114.   /*
  115.    * Output one character (may be one or two display cells).
  116.    * Caller must check for valid "off".
  117.    */
  118. !     static void
  119.   gui_screenchar(off, flags, fg, bg, back)
  120.       int        off;        /* Offset from start of screen */
  121.       int        flags;
  122. --- 1649,1657 ----
  123.   /*
  124.    * Output one character (may be one or two display cells).
  125.    * Caller must check for valid "off".
  126. +  * Returns FAIL or OK, just like gui_outstr_nowrap().
  127.    */
  128. !     static int
  129.   gui_screenchar(off, flags, fg, bg, back)
  130.       int        off;        /* Offset from start of screen */
  131.       int        flags;
  132. ***************
  133. *** 1661,1687 ****
  134.   
  135.       /* Don't draw right halve of a double-width UTF-8 char. "cannot happen" */
  136.       if (enc_utf8 && ScreenLines[off] == 0)
  137. !     return;
  138.       if (enc_utf8 && ScreenLinesUC[off] != 0)
  139.       /* Draw UTF-8 multi-byte character. */
  140. !     gui_outstr_nowrap(buf,
  141. !         utfc_char2bytes(off, buf),
  142. !         flags, fg, bg, 0);
  143. !     else if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
  144.       {
  145.       buf[0] = ScreenLines[off];
  146.       buf[1] = ScreenLines2[off];
  147. !     gui_outstr_nowrap(buf, 2, flags, fg, bg, 0);
  148.       }
  149. !     else
  150. !     /* Draw non-multi-byte character or DBCS character. */
  151. !     gui_outstr_nowrap(ScreenLines + off,
  152. !         enc_dbcs ? (*mb_ptr2len_check)(ScreenLines + off) : 1,
  153. !         flags, fg, bg, back);
  154.   #else
  155. !     gui_outstr_nowrap(ScreenLines + off,
  156. !         1,
  157. !         flags, fg, bg, back);
  158.   #endif
  159.   }
  160.   
  161. --- 1663,1688 ----
  162.   
  163.       /* Don't draw right halve of a double-width UTF-8 char. "cannot happen" */
  164.       if (enc_utf8 && ScreenLines[off] == 0)
  165. !     return OK;
  166.       if (enc_utf8 && ScreenLinesUC[off] != 0)
  167.       /* Draw UTF-8 multi-byte character. */
  168. !     return gui_outstr_nowrap(buf, utfc_char2bytes(off, buf),
  169. !                              flags, fg, bg, back);
  170. !     if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
  171.       {
  172.       buf[0] = ScreenLines[off];
  173.       buf[1] = ScreenLines2[off];
  174. !     return gui_outstr_nowrap(buf, 2, flags, fg, bg, back);
  175.       }
  176. !     /* Draw non-multi-byte character or DBCS character. */
  177. !     return gui_outstr_nowrap(ScreenLines + off,
  178. !         enc_dbcs ? (*mb_ptr2len_check)(ScreenLines + off) : 1,
  179. !                              flags, fg, bg, back);
  180.   #else
  181. !     return gui_outstr_nowrap(ScreenLines + off, 1, flags, fg, bg, back);
  182.   #endif
  183.   }
  184.   
  185. ***************
  186. *** 1693,1700 ****
  187.    * actually draw (an inverted) cursor.
  188.    * GUI_MON_TRS_CURSOR is used to draw the cursor text with a transparant
  189.    * background.
  190.    */
  191. !     void
  192.   gui_outstr_nowrap(s, len, flags, fg, bg, back)
  193.       char_u    *s;
  194.       int        len;
  195. --- 1694,1703 ----
  196.    * actually draw (an inverted) cursor.
  197.    * GUI_MON_TRS_CURSOR is used to draw the cursor text with a transparant
  198.    * background.
  199. +  * Returns OK, unless "back" is non-zero and using the bold trick, then return
  200. +  * FAIL (the caller should start drawing "back" chars back).
  201.    */
  202. !     int
  203.   gui_outstr_nowrap(s, len, flags, fg, bg, back)
  204.       char_u    *s;
  205.       int        len;
  206. ***************
  207. *** 1722,1728 ****
  208.       if (len < 0)
  209.       len = (int)STRLEN(s);
  210.       if (len == 0)
  211. !     return;
  212.   
  213.   #ifdef FEAT_SIGN_ICONS
  214.       if (*s == SIGN_BYTE)
  215. --- 1725,1731 ----
  216.       if (len < 0)
  217.       len = (int)STRLEN(s);
  218.       if (len == 0)
  219. !     return OK;
  220.   
  221.   #ifdef FEAT_SIGN_ICONS
  222.       if (*s == SIGN_BYTE)
  223. ***************
  224. *** 1853,1867 ****
  225.   
  226.       /*
  227.        * When drawing bold or italic characters the spill-over from the left
  228. !      * neighbor may be destroyed.  Backup to start redrawing just after a
  229. !      * blank.
  230.        */
  231. !     if ((draw_flags & DRAW_BOLD) || (highlight_mask & HL_ITALIC))
  232. !     {
  233. !     s -= back;
  234. !     len += back;
  235. !     col -= back;
  236. !     }
  237.   
  238.   #ifdef RISCOS
  239.       /* If there's no italic font, then fake it */
  240. --- 1856,1866 ----
  241.   
  242.       /*
  243.        * When drawing bold or italic characters the spill-over from the left
  244. !      * neighbor may be destroyed.  Let the caller backup to start redrawing
  245. !      * just after a blank.
  246.        */
  247. !     if (back != 0 && ((draw_flags & DRAW_BOLD) || (highlight_mask & HL_ITALIC)))
  248. !     return FAIL;
  249.   
  250.   #ifdef RISCOS
  251.       /* If there's no italic font, then fake it */
  252. ***************
  253. *** 2022,2027 ****
  254. --- 2021,2028 ----
  255.       /* Draw the sign on top of the spaces. */
  256.       gui_mch_drawsign(gui.row, col, gui.highlight_mask);
  257.   #endif
  258. +     return OK;
  259.   }
  260.   
  261.   /*
  262. ***************
  263. *** 2036,2042 ****
  264.   #ifdef FEAT_HANGULIN
  265.       if (composing_hangul
  266.               && gui.col == gui.cursor_col && gui.row == gui.cursor_row)
  267. !         gui_outstr_nowrap(composing_hangul_buffer, 2,
  268.               GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR,
  269.               gui.norm_pixel, gui.back_pixel, 0);
  270.       else
  271. --- 2037,2043 ----
  272.   #ifdef FEAT_HANGULIN
  273.       if (composing_hangul
  274.               && gui.col == gui.cursor_col && gui.row == gui.cursor_row)
  275. !         (void)gui_outstr_nowrap(composing_hangul_buffer, 2,
  276.               GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR,
  277.               gui.norm_pixel, gui.back_pixel, 0);
  278.       else
  279. ***************
  280. *** 2102,2108 ****
  281.       int        off;
  282.       char_u    first_attr;
  283.       int        idx, len;
  284. !     int        back;
  285.       int        retval = FALSE;
  286.   #ifdef FEAT_MBYTE
  287.       int        orig_col1, orig_col2;
  288. --- 2103,2109 ----
  289.       int        off;
  290.       char_u    first_attr;
  291.       int        idx, len;
  292. !     int        back, nback;
  293.       int        retval = FALSE;
  294.   #ifdef FEAT_MBYTE
  295.       int        orig_col1, orig_col2;
  296. ***************
  297. *** 2160,2169 ****
  298.           if (ScreenAttrs[off - 1 - back] != ScreenAttrs[off]
  299.               || ScreenLines[off - 1 - back] == ' ')
  300.           break;
  301. !     retval = (col1 > 0 && ScreenAttrs[off - 1] != 0 && back == 0);
  302.   
  303. !     /* break it up in strings of characters with the same attributes */
  304. !     /* print UTF-8 characters individually */
  305.       while (len > 0)
  306.       {
  307.           first_attr = ScreenAttrs[off];
  308. --- 2161,2171 ----
  309.           if (ScreenAttrs[off - 1 - back] != ScreenAttrs[off]
  310.               || ScreenLines[off - 1 - back] == ' ')
  311.           break;
  312. !     retval = (col1 > 0 && ScreenAttrs[off - 1] != 0 && back == 0
  313. !                           && ScreenLines[off - 1] != ' ');
  314.   
  315. !     /* Break it up in strings of characters with the same attributes. */
  316. !     /* Print UTF-8 characters individually. */
  317.       while (len > 0)
  318.       {
  319.           first_attr = ScreenAttrs[off];
  320. ***************
  321. *** 2172,2197 ****
  322.           if (enc_utf8 && ScreenLinesUC[off] != 0)
  323.           {
  324.           /* output multi-byte character separately */
  325. !         gui_screenchar(off, flags, (guicolor_T)0, (guicolor_T)0, back);
  326. !         ++off;
  327. !         --len;
  328. !         if (ScreenLines[off] == 0)
  329. !         {
  330. !             ++off;
  331. !             --len;
  332. !         }
  333.           }
  334.           else if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
  335.           {
  336.           /* output double-byte, single-width character separately */
  337. !         gui_screenchar(off, flags, (guicolor_T)0, (guicolor_T)0, back);
  338. !         ++off;
  339. !         --len;
  340.           }
  341.           else
  342.   #endif
  343.           {
  344. !         for (idx = 0; len > 0 && ScreenAttrs[off + idx] == first_attr;
  345.                                       idx++)
  346.           {
  347.   #ifdef FEAT_MBYTE
  348. --- 2174,2197 ----
  349.           if (enc_utf8 && ScreenLinesUC[off] != 0)
  350.           {
  351.           /* output multi-byte character separately */
  352. !         nback = gui_screenchar(off, flags,
  353. !                       (guicolor_T)0, (guicolor_T)0, back);
  354. !         if (gui.col < Columns && ScreenLines[off + 1] == 0)
  355. !             idx = 2;
  356. !         else
  357. !             idx = 1;
  358.           }
  359.           else if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
  360.           {
  361.           /* output double-byte, single-width character separately */
  362. !         nback = gui_screenchar(off, flags,
  363. !                       (guicolor_T)0, (guicolor_T)0, back);
  364. !         idx = 1;
  365.           }
  366.           else
  367.   #endif
  368.           {
  369. !         for (idx = 0; idx < len && ScreenAttrs[off + idx] == first_attr;
  370.                                       idx++)
  371.           {
  372.   #ifdef FEAT_MBYTE
  373. ***************
  374. *** 2205,2221 ****
  375.                   break;
  376.               if (len > 1 && (*mb_ptr2len_check)(ScreenLines
  377.                                   + off + idx) == 2)
  378. -             {
  379.                   ++idx;  /* skip second byte of double-byte char */
  380. -                 --len;
  381. -             }
  382.               }
  383.   #endif
  384. -             --len;
  385.           }
  386. !         gui_outstr_nowrap(ScreenLines + off, idx, flags,
  387.                         (guicolor_T)0, (guicolor_T)0, back);
  388.           off += idx;
  389.           }
  390.           back = 0;
  391.       }
  392. --- 2205,2229 ----
  393.                   break;
  394.               if (len > 1 && (*mb_ptr2len_check)(ScreenLines
  395.                                   + off + idx) == 2)
  396.                   ++idx;  /* skip second byte of double-byte char */
  397.               }
  398.   #endif
  399.           }
  400. !         nback = gui_outstr_nowrap(ScreenLines + off, idx, flags,
  401.                         (guicolor_T)0, (guicolor_T)0, back);
  402. +         }
  403. +         if (nback == FAIL)
  404. +         {
  405. +         /* Must back up to start drawing where a bold or italic word
  406. +          * starts. */
  407. +         off -= back;
  408. +         len += back;
  409. +         gui.col -= back;
  410. +         }
  411. +         else
  412. +         {
  413.           off += idx;
  414. +         len -= idx;
  415.           }
  416.           back = 0;
  417.       }
  418. *** ../vim60.208/src/gui_gtk_x11.c    Fri Dec 14 20:19:45 2001
  419. --- src/gui_gtk_x11.c    Sun Feb 10 21:41:49 2002
  420. ***************
  421. *** 2445,2509 ****
  422.   #endif
  423.   
  424.   /*
  425. !  * Try to load the requested single font.
  426.    */
  427. !     static GuiFont
  428. ! get_font(char_u *font_name)
  429.   {
  430. !     if (STRCMP(font_name, "*") == 0)
  431.       {
  432. !     /* Request for a font handling dialog.
  433. !      */
  434. !     if (!gui.fontdlg)
  435. !     {
  436. !         GtkFontSelectionDialog    *fsd = NULL;
  437.   
  438. !         gui.fontdlg = gtk_font_selection_dialog_new(_("Font Selection"));
  439. !         fsd = GTK_FONT_SELECTION_DIALOG(gui.fontdlg);
  440. !         if (p_guifont != NULL)
  441. !         gtk_font_selection_dialog_set_font_name(fsd,
  442. !             (char *)p_guifont);
  443. !         gtk_window_set_modal(GTK_WINDOW(gui.fontdlg), TRUE);
  444. !         gtk_window_set_transient_for(GTK_WINDOW(gui.fontdlg),
  445. !             GTK_WINDOW(gui.mainwin));
  446. !         gtk_signal_connect(GTK_OBJECT(gui.fontdlg), "destroy",
  447. !             GTK_SIGNAL_FUNC(font_sel_destroy), &gui);
  448. !         gtk_signal_connect(GTK_OBJECT(fsd->ok_button), "clicked",
  449. !             GTK_SIGNAL_FUNC(font_sel_ok), &gui);
  450. !         gtk_signal_connect(GTK_OBJECT(fsd->cancel_button), "clicked",
  451. !             GTK_SIGNAL_FUNC(font_sel_cancel), &gui);
  452. !     }
  453. !     if (gui.fontname)
  454. !     {
  455. !         g_free(gui.fontname);
  456. !         gui.fontname = NULL;
  457. !     }
  458. !     gtk_window_position(GTK_WINDOW(gui.fontdlg), GTK_WIN_POS_MOUSE);
  459. !     gtk_widget_show(gui.fontdlg);
  460. !     {
  461. !         static gchar        *spacings[] = {"c", "m", NULL};
  462.   
  463. !         /* In GTK 1.2.3 this must be after the gtk_widget_show() call,
  464. !          * otherwise everything is blocked for ten seconds. */
  465. !         gtk_font_selection_dialog_set_filter(
  466. !             GTK_FONT_SELECTION_DIALOG(gui.fontdlg),
  467. !             GTK_FONT_FILTER_BASE,
  468. !             GTK_FONT_ALL, NULL, NULL,
  469. !             NULL, NULL, spacings, NULL);
  470. !     }
  471.   
  472. !     while (gui.fontdlg && GTK_WIDGET_VISIBLE(gui.fontdlg))
  473. !         gtk_main_iteration_do(TRUE);
  474.   
  475. !     if (gui.fontname == NULL)
  476. !         return NOFONT;
  477. !     vim_free(p_guifont);
  478. !     p_guifont = vim_strsave(gui.fontname);
  479. !     font_name = p_guifont;
  480.       }
  481.   
  482. !     return gui_mch_get_font(font_name, FALSE);
  483.   }
  484.   
  485.   /*
  486. --- 2445,2504 ----
  487.   #endif
  488.   
  489.   /*
  490. !  * Put up a font dialog and return the selected font name in allocated memory.
  491. !  * "oldval" is the previous value.
  492. !  * Return NULL when cancelled.
  493.    */
  494. !     char_u *
  495. ! gui_mch_font_dialog(char_u *oldval)
  496.   {
  497. !     if (!gui.fontdlg)
  498.       {
  499. !     GtkFontSelectionDialog    *fsd = NULL;
  500.   
  501. !     gui.fontdlg = gtk_font_selection_dialog_new(_("Font Selection"));
  502. !     fsd = GTK_FONT_SELECTION_DIALOG(gui.fontdlg);
  503. !     gtk_window_set_modal(GTK_WINDOW(gui.fontdlg), TRUE);
  504. !     gtk_window_set_transient_for(GTK_WINDOW(gui.fontdlg),
  505. !         GTK_WINDOW(gui.mainwin));
  506. !     gtk_signal_connect(GTK_OBJECT(gui.fontdlg), "destroy",
  507. !         GTK_SIGNAL_FUNC(font_sel_destroy), &gui);
  508. !     gtk_signal_connect(GTK_OBJECT(fsd->ok_button), "clicked",
  509. !         GTK_SIGNAL_FUNC(font_sel_ok), &gui);
  510. !     gtk_signal_connect(GTK_OBJECT(fsd->cancel_button), "clicked",
  511. !         GTK_SIGNAL_FUNC(font_sel_cancel), &gui);
  512. !     }
  513.   
  514. !     if (oldval != NULL && *oldval != NUL)
  515. !     gtk_font_selection_dialog_set_font_name(
  516. !         GTK_FONT_SELECTION_DIALOG(gui.fontdlg), (char *)oldval);
  517.   
  518. !     if (gui.fontname)
  519. !     {
  520. !     g_free(gui.fontname);
  521. !     gui.fontname = NULL;
  522. !     }
  523. !     gtk_window_position(GTK_WINDOW(gui.fontdlg), GTK_WIN_POS_MOUSE);
  524. !     gtk_widget_show(gui.fontdlg);
  525. !     {
  526. !     static gchar    *spacings[] = {"c", "m", NULL};
  527.   
  528. !     /* In GTK 1.2.3 this must be after the gtk_widget_show() call,
  529. !      * otherwise everything is blocked for ten seconds. */
  530. !     gtk_font_selection_dialog_set_filter(
  531. !         GTK_FONT_SELECTION_DIALOG(gui.fontdlg),
  532. !         GTK_FONT_FILTER_BASE,
  533. !         GTK_FONT_ALL, NULL, NULL,
  534. !         NULL, NULL, spacings, NULL);
  535.       }
  536.   
  537. !     /* Wait for the font dialog to be closed. */
  538. !     while (gui.fontdlg && GTK_WIDGET_VISIBLE(gui.fontdlg))
  539. !     gtk_main_iteration_do(TRUE);
  540. !     if (gui.fontname == NULL)
  541. !     return NULL;
  542. !     return vim_strsave(gui.fontname);
  543.   }
  544.   
  545.   /*
  546. ***************
  547. *** 2619,2625 ****
  548.        * be present on all X11 servers. */
  549.       if (font_name == NULL)
  550.           font_name = (char_u *)DFLT_FONT;
  551. !     font = get_font(font_name);
  552.       }
  553.   
  554.       if (font == NULL)
  555. --- 2614,2620 ----
  556.        * be present on all X11 servers. */
  557.       if (font_name == NULL)
  558.           font_name = (char_u *)DFLT_FONT;
  559. !     font = gui_mch_get_font(font_name, FALSE);
  560.       }
  561.   
  562.       if (font == NULL)
  563. *** ../vim60.208/src/option.c    Fri Feb  8 10:30:44 2002
  564. --- src/option.c    Mon Feb 11 10:19:01 2002
  565. ***************
  566. *** 4734,4745 ****
  567.       /* 'guifont' */
  568.       else if (varp == &p_guifont)
  569.       {
  570. !     if (gui.in_use && gui_init_font(p_guifont, FALSE) != OK
  571. ! # if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)
  572. !         && *p_guifont != '*'
  573.   # endif
  574. !         )
  575. !         errmsg = (char_u *)N_("Invalid font(s)");
  576.       }
  577.   # ifdef FEAT_XFONTSET
  578.       else if (varp == &p_guifontset)
  579. --- 4734,4766 ----
  580.       /* 'guifont' */
  581.       else if (varp == &p_guifont)
  582.       {
  583. !     if (gui.in_use)
  584. !     {
  585. ! # ifdef FEAT_GUI_GTK
  586. !         if (STRCMP(p_guifont, "*") == 0)
  587. !         {
  588. !         /*
  589. !          * Put up a font dialog and let the user select a new value.
  590. !          * If this is cancelled go back to the old value but don't
  591. !          * give an error message.
  592. !          */
  593. !         p = gui_mch_font_dialog(oldval);
  594. !         if (p != NULL)
  595. !         {
  596. !             free_string_option(p_guifont);
  597. !             p_guifont = p;
  598. !         }
  599. !         else
  600. !             errmsg = (char_u *)"";
  601. !         }
  602.   # endif
  603. !         if (errmsg == NULL && gui_init_font(p_guifont, FALSE) != OK
  604. ! # if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_PHOTON)
  605. !             && STRCMP(p_guifont, "*") != 0
  606. ! # endif
  607. !            )
  608. !         errmsg = (char_u *)N_("Invalid font(s)");
  609. !     }
  610.       }
  611.   # ifdef FEAT_XFONTSET
  612.       else if (varp == &p_guifontset)
  613. *** ../vim60.208/src/proto/gui.pro    Tue Sep 25 21:49:28 2001
  614. --- src/proto/gui.pro    Mon Feb 11 11:29:04 2002
  615. ***************
  616. *** 25,31 ****
  617.   void gui_write __ARGS((char_u *s, int len));
  618.   void gui_dont_update_cursor __ARGS((void));
  619.   void gui_can_update_cursor __ARGS((void));
  620. ! void gui_outstr_nowrap __ARGS((char_u *s, int len, int flags, guicolor_T fg, guicolor_T bg, int back));
  621.   void gui_undraw_cursor __ARGS((void));
  622.   void gui_redraw __ARGS((int x, int y, int w, int h));
  623.   int gui_redraw_block __ARGS((int row1, int col1, int row2, int col2, int flags));
  624. --- 25,31 ----
  625.   void gui_write __ARGS((char_u *s, int len));
  626.   void gui_dont_update_cursor __ARGS((void));
  627.   void gui_can_update_cursor __ARGS((void));
  628. ! int gui_outstr_nowrap __ARGS((char_u *s, int len, int flags, guicolor_T fg, guicolor_T bg, int back));
  629.   void gui_undraw_cursor __ARGS((void));
  630.   void gui_redraw __ARGS((int x, int y, int w, int h));
  631.   int gui_redraw_block __ARGS((int row1, int col1, int row2, int col2, int flags));
  632. *** ../vim60.208/src/proto/gui_gtk_x11.pro    Tue Sep 25 21:49:30 2001
  633. --- src/proto/gui_gtk_x11.pro    Sun Feb 10 21:40:25 2002
  634. ***************
  635. *** 16,21 ****
  636. --- 16,22 ----
  637.   void gui_mch_show_toolbar __ARGS((int showit));
  638.   int gui_mch_adjust_charsize __ARGS((void));
  639.   GuiFontset gui_mch_get_fontset __ARGS((char_u *name, int report_error, int fixed_width));
  640. + char_u *gui_mch_font_dialog __ARGS((char_u *oldval));
  641.   int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
  642.   GuiFont gui_mch_get_font __ARGS((char_u *name, int report_error));
  643.   void gui_mch_set_font __ARGS((GuiFont font));
  644. *** ../vim60.208/src/version.c    Sun Feb 10 17:03:39 2002
  645. --- src/version.c    Mon Feb 11 11:55:19 2002
  646. ***************
  647. *** 608,609 ****
  648. --- 608,611 ----
  649.   {   /* Add new patch number below this line */
  650. + /**/
  651. +     209,
  652.   /**/
  653.  
  654. -- 
  655. Shit makes the flowers grow and that's beautiful
  656.  
  657.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  658. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  659.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  660.