lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
cc85ded
To: vim-dev@vim.org
cc85ded
Subject: Patch 7.2.424
cc85ded
Fcc: outbox
cc85ded
From: Bram Moolenaar <Bram@moolenaar.net>
cc85ded
Mime-Version: 1.0
cc85ded
Content-Type: text/plain; charset=UTF-8
cc85ded
Content-Transfer-Encoding: 8bit
cc85ded
------------
cc85ded
cc85ded
Patch 7.2.424
cc85ded
Problem:    ":colorscheme" without an argument doesn't do anything.
cc85ded
Solution:   Make it echo the current color scheme name.  (partly by Christian
cc85ded
	    Brabandt)
cc85ded
Files:	    runtime/doc/syntax.txt, src/ex_cmds.h, src/ex_docmd.c
cc85ded
cc85ded
cc85ded
*** ../vim-7.2.423/runtime/doc/syntax.txt	2008-08-09 19:36:52.000000000 +0200
cc85ded
--- runtime/doc/syntax.txt	2010-05-14 15:27:47.000000000 +0200
cc85ded
***************
cc85ded
*** 113,118 ****
cc85ded
--- 113,121 ----
cc85ded
      :syntax off		$VIMRUNTIME/syntax/nosyntax.vim
cc85ded
  Also see |syntax-loading|.
cc85ded
  
cc85ded
+ NOTE: If displaying long lines is slow and switching off syntax highlighting
cc85ded
+ makes it fast, consider setting the 'synmaxcol' option to a lower value.
cc85ded
+ 
cc85ded
  ==============================================================================
cc85ded
  2. Syntax files						*:syn-files*
cc85ded
  
cc85ded
***************
cc85ded
*** 3829,3841 ****
cc85ded
  in their own color.
cc85ded
  
cc85ded
  						*:colo* *:colorscheme* *E185*
cc85ded
  :colo[rscheme] {name}	Load color scheme {name}.  This searches 'runtimepath'
cc85ded
  			for the file "colors/{name}.vim.  The first one that
cc85ded
  			is found is loaded.
cc85ded
! 			To see the name of the currently active color scheme
cc85ded
! 			(if there is one): >
cc85ded
! 				:echo g:colors_name
cc85ded
! <			Doesn't work recursively, thus you can't use
cc85ded
  			":colorscheme" in a color scheme script.
cc85ded
  			After the color scheme has been loaded the
cc85ded
  			|ColorScheme| autocommand event is triggered.
cc85ded
--- 3871,3890 ----
cc85ded
  in their own color.
cc85ded
  
cc85ded
  						*:colo* *:colorscheme* *E185*
cc85ded
+ :colo[rscheme]		Output the name of the currently active color scheme.
cc85ded
+ 			This is basically the same as >
cc85ded
+ 				:echo g:colors_name
cc85ded
+ <			In case g:colors_name has not been defined :colo will
cc85ded
+ 			output "default".  When compiled without the |+eval|
cc85ded
+ 			feature it will output "unknown".
cc85ded
+ 
cc85ded
  :colo[rscheme] {name}	Load color scheme {name}.  This searches 'runtimepath'
cc85ded
  			for the file "colors/{name}.vim.  The first one that
cc85ded
  			is found is loaded.
cc85ded
! 			To see the name of the currently active color scheme: >
cc85ded
! 				:colo
cc85ded
! <			The name is also stored in the g:colors_name variable.
cc85ded
! 			Doesn't work recursively, thus you can't use
cc85ded
  			":colorscheme" in a color scheme script.
cc85ded
  			After the color scheme has been loaded the
cc85ded
  			|ColorScheme| autocommand event is triggered.
cc85ded
***************
cc85ded
*** 4032,4038 ****
cc85ded
  	colors.
cc85ded
  	When a colorscheme is being used, changing 'background' causes it to
cc85ded
  	be reloaded, which may reset all colors (including Normal).  First
cc85ded
! 	delete the "colors_name" variable when you don't want this.
cc85ded
  
cc85ded
  	When you have set "ctermfg" or "ctermbg" for the Normal group, Vim
cc85ded
  	needs to reset the color when exiting.	This is done with the "op"
cc85ded
--- 4081,4087 ----
cc85ded
  	colors.
cc85ded
  	When a colorscheme is being used, changing 'background' causes it to
cc85ded
  	be reloaded, which may reset all colors (including Normal).  First
cc85ded
! 	delete the "g:colors_name" variable when you don't want this.
cc85ded
  
cc85ded
  	When you have set "ctermfg" or "ctermbg" for the Normal group, Vim
cc85ded
  	needs to reset the color when exiting.	This is done with the "op"
cc85ded
*** ../vim-7.2.423/src/ex_cmds.h	2010-05-13 16:46:16.000000000 +0200
cc85ded
--- src/ex_cmds.h	2010-05-14 13:08:45.000000000 +0200
cc85ded
***************
cc85ded
*** 256,262 ****
cc85ded
  EX(CMD_colder,		"colder",	qf_age,
cc85ded
  			RANGE|NOTADR|COUNT|TRLBAR),
cc85ded
  EX(CMD_colorscheme,	"colorscheme",	ex_colorscheme,
cc85ded
! 			NEEDARG|WORD1|TRLBAR|CMDWIN),
cc85ded
  EX(CMD_command,		"command",	ex_command,
cc85ded
  			EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN),
cc85ded
  EX(CMD_comclear,	"comclear",	ex_comclear,
cc85ded
--- 256,262 ----
cc85ded
  EX(CMD_colder,		"colder",	qf_age,
cc85ded
  			RANGE|NOTADR|COUNT|TRLBAR),
cc85ded
  EX(CMD_colorscheme,	"colorscheme",	ex_colorscheme,
cc85ded
! 			WORD1|TRLBAR|CMDWIN),
cc85ded
  EX(CMD_command,		"command",	ex_command,
cc85ded
  			EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN),
cc85ded
  EX(CMD_comclear,	"comclear",	ex_comclear,
cc85ded
*** ../vim-7.2.423/src/ex_docmd.c	2010-03-02 15:55:51.000000000 +0100
cc85ded
--- src/ex_docmd.c	2010-05-14 15:26:14.000000000 +0200
cc85ded
***************
cc85ded
*** 6226,6232 ****
cc85ded
  ex_colorscheme(eap)
cc85ded
      exarg_T	*eap;
cc85ded
  {
cc85ded
!     if (load_colors(eap->arg) == FAIL)
cc85ded
  	EMSG2(_("E185: Cannot find color scheme %s"), eap->arg);
cc85ded
  }
cc85ded
  
cc85ded
--- 6226,6256 ----
cc85ded
  ex_colorscheme(eap)
cc85ded
      exarg_T	*eap;
cc85ded
  {
cc85ded
!     if (*eap->arg == NUL)
cc85ded
!     {
cc85ded
! #ifdef FEAT_EVAL
cc85ded
! 	char_u *expr = vim_strsave((char_u *)"g:colors_name");
cc85ded
! 	char_u *p = NULL;
cc85ded
! 
cc85ded
! 	if (expr != NULL)
cc85ded
! 	{
cc85ded
! 	    ++emsg_off;
cc85ded
! 	    p = eval_to_string(expr, NULL, FALSE);
cc85ded
! 	    --emsg_off;
cc85ded
! 	    vim_free(expr);
cc85ded
! 	}
cc85ded
! 	if (p != NULL)
cc85ded
! 	{
cc85ded
! 	    MSG(p);
cc85ded
! 	    vim_free(p);
cc85ded
! 	}
cc85ded
! 	else
cc85ded
! 	    MSG("default");
cc85ded
! #else
cc85ded
! 	MSG(_("unknown"));
cc85ded
! #endif
cc85ded
!     }
cc85ded
!     else if (load_colors(eap->arg) == FAIL)
cc85ded
  	EMSG2(_("E185: Cannot find color scheme %s"), eap->arg);
cc85ded
  }
cc85ded
  
cc85ded
*** ../vim-7.2.423/src/version.c	2010-05-14 12:16:19.000000000 +0200
cc85ded
--- src/version.c	2010-05-14 15:23:20.000000000 +0200
cc85ded
***************
cc85ded
*** 683,684 ****
cc85ded
--- 683,686 ----
cc85ded
  {   /* Add new patch number below this line */
cc85ded
+ /**/
cc85ded
+     424,
cc85ded
  /**/
cc85ded
cc85ded
-- 
cc85ded
Everyone has a photographic memory. Some don't have film.
cc85ded
cc85ded
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
cc85ded
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
cc85ded
\\\        download, build and distribute -- http://www.A-A-P.org        ///
cc85ded
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///