Karsten Hopp f17f33
To: vim-dev@vim.org
Karsten Hopp f17f33
Subject: Patch 7.2.144
Karsten Hopp f17f33
Fcc: outbox
Karsten Hopp f17f33
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp f17f33
Mime-Version: 1.0
Karsten Hopp f17f33
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp f17f33
Content-Transfer-Encoding: 8bit
Karsten Hopp f17f33
------------
Karsten Hopp f17f33
Karsten Hopp f17f33
Patch 7.2.144
Karsten Hopp f17f33
Problem:    When 't_Co' is set to the value it already had the color scheme is
Karsten Hopp f17f33
            reloaded anyway.
Karsten Hopp f17f33
Solution:   Only load the colorscheme when the t_Co value changes. (Dominique
Karsten Hopp f17f33
            Pelle)
Karsten Hopp f17f33
Files:      src/option.c
Karsten Hopp f17f33
Karsten Hopp f17f33
Karsten Hopp f17f33
*** ../vim-7.2.143/src/option.c	Wed Mar  4 04:11:56 2009
Karsten Hopp f17f33
--- src/option.c	Wed Mar 18 12:00:28 2009
Karsten Hopp f17f33
***************
Karsten Hopp f17f33
*** 6022,6036 ****
Karsten Hopp f17f33
  	/* ":set t_Co=0" and ":set t_Co=1" do ":set t_Co=" */
Karsten Hopp f17f33
  	if (varp == &T_CCO)
Karsten Hopp f17f33
  	{
Karsten Hopp f17f33
! 	    t_colors = atoi((char *)T_CCO);
Karsten Hopp f17f33
! 	    if (t_colors <= 1)
Karsten Hopp f17f33
  	    {
Karsten Hopp f17f33
! 		if (new_value_alloced)
Karsten Hopp f17f33
! 		    vim_free(T_CCO);
Karsten Hopp f17f33
! 		T_CCO = empty_option;
Karsten Hopp f17f33
  	    }
Karsten Hopp f17f33
- 	    /* We now have a different color setup, initialize it again. */
Karsten Hopp f17f33
- 	    init_highlight(TRUE, FALSE);
Karsten Hopp f17f33
  	}
Karsten Hopp f17f33
  	ttest(FALSE);
Karsten Hopp f17f33
  	if (varp == &T_ME)
Karsten Hopp f17f33
--- 6022,6044 ----
Karsten Hopp f17f33
  	/* ":set t_Co=0" and ":set t_Co=1" do ":set t_Co=" */
Karsten Hopp f17f33
  	if (varp == &T_CCO)
Karsten Hopp f17f33
  	{
Karsten Hopp f17f33
! 	    int colors = atoi((char *)T_CCO);
Karsten Hopp f17f33
! 
Karsten Hopp f17f33
! 	    /* Only reinitialize colors if t_Co value has really changed to
Karsten Hopp f17f33
! 	     * avoid expensive reload of colorscheme if t_Co is set to the
Karsten Hopp f17f33
! 	     * same value multiple times. */
Karsten Hopp f17f33
! 	    if (colors != t_colors)
Karsten Hopp f17f33
  	    {
Karsten Hopp f17f33
! 		t_colors = colors;
Karsten Hopp f17f33
! 		if (t_colors <= 1)
Karsten Hopp f17f33
! 		{
Karsten Hopp f17f33
! 		    if (new_value_alloced)
Karsten Hopp f17f33
! 			vim_free(T_CCO);
Karsten Hopp f17f33
! 		    T_CCO = empty_option;
Karsten Hopp f17f33
! 		}
Karsten Hopp f17f33
! 		/* We now have a different color setup, initialize it again. */
Karsten Hopp f17f33
! 		init_highlight(TRUE, FALSE);
Karsten Hopp f17f33
  	    }
Karsten Hopp f17f33
  	}
Karsten Hopp f17f33
  	ttest(FALSE);
Karsten Hopp f17f33
  	if (varp == &T_ME)
Karsten Hopp f17f33
*** ../vim-7.2.143/src/version.c	Wed Mar 18 12:50:58 2009
Karsten Hopp f17f33
--- src/version.c	Wed Mar 18 14:16:48 2009
Karsten Hopp f17f33
***************
Karsten Hopp f17f33
*** 678,679 ****
Karsten Hopp f17f33
--- 678,681 ----
Karsten Hopp f17f33
  {   /* Add new patch number below this line */
Karsten Hopp f17f33
+ /**/
Karsten Hopp f17f33
+     144,
Karsten Hopp f17f33
  /**/
Karsten Hopp f17f33
Karsten Hopp f17f33
-- 
Karsten Hopp f17f33
hundred-and-one symptoms of being an internet addict:
Karsten Hopp f17f33
235. You start naming your kids Pascal, COBOL, Algol and Fortran.
Karsten Hopp f17f33
Karsten Hopp f17f33
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp f17f33
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp f17f33
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp f17f33
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///