Karsten Hopp 23a93b
To: vim-dev@vim.org
Karsten Hopp 23a93b
Subject: Patch 7.2.099
Karsten Hopp 23a93b
Fcc: outbox
Karsten Hopp 23a93b
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 23a93b
Mime-Version: 1.0
Karsten Hopp 23a93b
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 23a93b
Content-Transfer-Encoding: 8bit
Karsten Hopp 23a93b
------------
Karsten Hopp 23a93b
Karsten Hopp 23a93b
Patch 7.2.099
Karsten Hopp 23a93b
Problem:    Changing GUI options causes an unnecessary redraw when the GUI
Karsten Hopp 23a93b
	    isn't active.
Karsten Hopp 23a93b
Solution:   Avoid the redraw. (Lech Lorens)
Karsten Hopp 23a93b
Files:	    src/option.c
Karsten Hopp 23a93b
Karsten Hopp 23a93b
Karsten Hopp 23a93b
*** ../vim-7.2.098/src/option.c	Wed Dec 24 12:53:33 2008
Karsten Hopp 23a93b
--- src/option.c	Wed Feb  4 16:59:56 2009
Karsten Hopp 23a93b
***************
Karsten Hopp 23a93b
*** 5407,5412 ****
Karsten Hopp 23a93b
--- 5407,5416 ----
Karsten Hopp 23a93b
      int		did_chartab = FALSE;
Karsten Hopp 23a93b
      char_u	**gvarp;
Karsten Hopp 23a93b
      long_u	free_oldval = (options[opt_idx].flags & P_ALLOCED);
Karsten Hopp 23a93b
+ #ifdef FEAT_GUI
Karsten Hopp 23a93b
+     /* set when changing an option that only requires a redraw in the GUI */
Karsten Hopp 23a93b
+     int		redraw_gui_only = FALSE;
Karsten Hopp 23a93b
+ #endif
Karsten Hopp 23a93b
  
Karsten Hopp 23a93b
      /* Get the global option to compare with, otherwise we would have to check
Karsten Hopp 23a93b
       * two values for all local options. */
Karsten Hopp 23a93b
***************
Karsten Hopp 23a93b
*** 6055,6060 ****
Karsten Hopp 23a93b
--- 6059,6065 ----
Karsten Hopp 23a93b
  		    errmsg = (char_u *)N_("E596: Invalid font(s)");
Karsten Hopp 23a93b
  	    }
Karsten Hopp 23a93b
  	}
Karsten Hopp 23a93b
+ 	redraw_gui_only = TRUE;
Karsten Hopp 23a93b
      }
Karsten Hopp 23a93b
  # ifdef FEAT_XFONTSET
Karsten Hopp 23a93b
      else if (varp == &p_guifontset)
Karsten Hopp 23a93b
***************
Karsten Hopp 23a93b
*** 6063,6068 ****
Karsten Hopp 23a93b
--- 6068,6074 ----
Karsten Hopp 23a93b
  	    errmsg = (char_u *)N_("E597: can't select fontset");
Karsten Hopp 23a93b
  	else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK)
Karsten Hopp 23a93b
  	    errmsg = (char_u *)N_("E598: Invalid fontset");
Karsten Hopp 23a93b
+ 	redraw_gui_only = TRUE;
Karsten Hopp 23a93b
      }
Karsten Hopp 23a93b
  # endif
Karsten Hopp 23a93b
  # ifdef FEAT_MBYTE
Karsten Hopp 23a93b
***************
Karsten Hopp 23a93b
*** 6072,6077 ****
Karsten Hopp 23a93b
--- 6078,6084 ----
Karsten Hopp 23a93b
  	    errmsg = (char_u *)N_("E533: can't select wide font");
Karsten Hopp 23a93b
  	else if (gui_get_wide_font() == FAIL)
Karsten Hopp 23a93b
  	    errmsg = (char_u *)N_("E534: Invalid wide font");
Karsten Hopp 23a93b
+ 	redraw_gui_only = TRUE;
Karsten Hopp 23a93b
      }
Karsten Hopp 23a93b
  # endif
Karsten Hopp 23a93b
  #endif
Karsten Hopp 23a93b
***************
Karsten Hopp 23a93b
*** 6133,6145 ****
Karsten Hopp 23a93b
--- 6140,6163 ----
Karsten Hopp 23a93b
  #ifdef FEAT_GUI
Karsten Hopp 23a93b
      /* 'guioptions' */
Karsten Hopp 23a93b
      else if (varp == &p_go)
Karsten Hopp 23a93b
+     {
Karsten Hopp 23a93b
  	gui_init_which_components(oldval);
Karsten Hopp 23a93b
+ 	redraw_gui_only = TRUE;
Karsten Hopp 23a93b
+     }
Karsten Hopp 23a93b
  #endif
Karsten Hopp 23a93b
  
Karsten Hopp 23a93b
  #if defined(FEAT_GUI_TABLINE)
Karsten Hopp 23a93b
      /* 'guitablabel' */
Karsten Hopp 23a93b
      else if (varp == &p_gtl)
Karsten Hopp 23a93b
+     {
Karsten Hopp 23a93b
  	redraw_tabline = TRUE;
Karsten Hopp 23a93b
+ 	redraw_gui_only = TRUE;
Karsten Hopp 23a93b
+     }
Karsten Hopp 23a93b
+     /* 'guitabtooltip' */
Karsten Hopp 23a93b
+     else if (varp == &p_gtt)
Karsten Hopp 23a93b
+     {
Karsten Hopp 23a93b
+ 	redraw_gui_only = TRUE;
Karsten Hopp 23a93b
+     }
Karsten Hopp 23a93b
  #endif
Karsten Hopp 23a93b
  
Karsten Hopp 23a93b
  #if defined(FEAT_MOUSE_TTY) && (defined(UNIX) || defined(VMS))
Karsten Hopp 23a93b
***************
Karsten Hopp 23a93b
*** 6717,6723 ****
Karsten Hopp 23a93b
  
Karsten Hopp 23a93b
      if (curwin->w_curswant != MAXCOL)
Karsten Hopp 23a93b
  	curwin->w_set_curswant = TRUE;  /* in case 'showbreak' changed */
Karsten Hopp 23a93b
!     check_redraw(options[opt_idx].flags);
Karsten Hopp 23a93b
  
Karsten Hopp 23a93b
      return errmsg;
Karsten Hopp 23a93b
  }
Karsten Hopp 23a93b
--- 6735,6745 ----
Karsten Hopp 23a93b
  
Karsten Hopp 23a93b
      if (curwin->w_curswant != MAXCOL)
Karsten Hopp 23a93b
  	curwin->w_set_curswant = TRUE;  /* in case 'showbreak' changed */
Karsten Hopp 23a93b
! #ifdef FEAT_GUI
Karsten Hopp 23a93b
!     /* check redraw when it's not a GUI option or the GUI is active. */
Karsten Hopp 23a93b
!     if (!redraw_gui_only || gui.in_use)
Karsten Hopp 23a93b
! #endif
Karsten Hopp 23a93b
! 	check_redraw(options[opt_idx].flags);
Karsten Hopp 23a93b
  
Karsten Hopp 23a93b
      return errmsg;
Karsten Hopp 23a93b
  }
Karsten Hopp 23a93b
*** ../vim-7.2.098/src/version.c	Wed Feb  4 16:25:53 2009
Karsten Hopp 23a93b
--- src/version.c	Wed Feb  4 17:24:11 2009
Karsten Hopp 23a93b
***************
Karsten Hopp 23a93b
*** 678,679 ****
Karsten Hopp 23a93b
--- 678,681 ----
Karsten Hopp 23a93b
  {   /* Add new patch number below this line */
Karsten Hopp 23a93b
+ /**/
Karsten Hopp 23a93b
+     99,
Karsten Hopp 23a93b
  /**/
Karsten Hopp 23a93b
Karsten Hopp 23a93b
-- 
Karsten Hopp 23a93b
I started out with nothing, and I still have most of it.
Karsten Hopp 23a93b
                                -- Michael Davis -- "Tonight Show"
Karsten Hopp 23a93b
Karsten Hopp 23a93b
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 23a93b
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 23a93b
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 23a93b
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///