The attached patch gets rid of the unnecessary screen redraw when
'guifont', 'guifontset' or 'guifontwide' is set in Vim running in a console.

-- 
Cheers,
Lech

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Index: src/option.c
===================================================================
--- src/option.c	(revision 1341)
+++ src/option.c	(working copy)
@@ -5407,6 +5407,9 @@
     int		did_chartab = FALSE;
     char_u	**gvarp;
     long_u	free_oldval = (options[opt_idx].flags & P_ALLOCED);
+#ifdef FEAT_GUI
+    int		dont_check_redraw = FALSE;
+#endif
 
     /* Get the global option to compare with, otherwise we would have to check
      * two values for all local options. */
@@ -6055,6 +6058,8 @@
 		    errmsg = (char_u *)N_("E596: Invalid font(s)");
 	    }
 	}
+	else
+	    dont_check_redraw = TRUE;
     }
 # ifdef FEAT_XFONTSET
     else if (varp == &p_guifontset)
@@ -6063,6 +6068,8 @@
 	    errmsg = (char_u *)N_("E597: can't select fontset");
 	else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK)
 	    errmsg = (char_u *)N_("E598: Invalid fontset");
+	if (!gui.in_use)
+	    dont_check_redraw = TRUE;
     }
 # endif
 # ifdef FEAT_MBYTE
@@ -6072,6 +6079,8 @@
 	    errmsg = (char_u *)N_("E533: can't select wide font");
 	else if (gui_get_wide_font() == FAIL)
 	    errmsg = (char_u *)N_("E534: Invalid wide font");
+	if (!gui.in_use)
+	    dont_check_redraw = TRUE;
     }
 # endif
 #endif
@@ -6717,7 +6726,10 @@
 
     if (curwin->w_curswant != MAXCOL)
 	curwin->w_set_curswant = TRUE;  /* in case 'showbreak' changed */
-    check_redraw(options[opt_idx].flags);
+#ifdef FEAT_GUI
+    if (!dont_check_redraw)
+#endif
+	check_redraw(options[opt_idx].flags);
 
     return errmsg;
 }
Index: runtime/doc/todo.txt
===================================================================
--- runtime/doc/todo.txt	(revision 1341)
+++ runtime/doc/todo.txt	(working copy)
@@ -369,8 +369,6 @@
 Test 61 fails sometimes.  This is a timing problem: "sleep 2" sometimes takes
 longer than 2 seconds.
 
-Changing 'guifont' in the console causes an unnecessary redraw.
-
 "vim -C" often has 'nocompatible', because it's set in some startup script.
 Set 'compatible' after startup is done?  Patch by James Vega, 2008 Feb 7.
 

Raspunde prin e-mail lui