changeset 2142:c60d231453cf v7.2.424

updated for version 7.2.424 Problem: ":colorscheme" without an argument doesn't do anything. Solution: Make it echo the current color scheme name. (partly by Christian Brabandt)
author Bram Moolenaar <bram@zimbu.org>
date Fri, 14 May 2010 15:28:44 +0200
parents e10d3c073449
children 79d111ea8ef6
files src/ex_cmds.h src/ex_docmd.c src/version.c
diffstat 3 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -256,7 +256,7 @@ EX(CMD_copy,		"copy",		ex_copymove,
 EX(CMD_colder,		"colder",	qf_age,
 			RANGE|NOTADR|COUNT|TRLBAR),
 EX(CMD_colorscheme,	"colorscheme",	ex_colorscheme,
-			NEEDARG|WORD1|TRLBAR|CMDWIN),
+			WORD1|TRLBAR|CMDWIN),
 EX(CMD_command,		"command",	ex_command,
 			EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN),
 EX(CMD_comclear,	"comclear",	ex_comclear,
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -6226,7 +6226,31 @@ parse_compl_arg(value, vallen, complp, a
 ex_colorscheme(eap)
     exarg_T	*eap;
 {
-    if (load_colors(eap->arg) == FAIL)
+    if (*eap->arg == NUL)
+    {
+#ifdef FEAT_EVAL
+	char_u *expr = vim_strsave((char_u *)"g:colors_name");
+	char_u *p = NULL;
+
+	if (expr != NULL)
+	{
+	    ++emsg_off;
+	    p = eval_to_string(expr, NULL, FALSE);
+	    --emsg_off;
+	    vim_free(expr);
+	}
+	if (p != NULL)
+	{
+	    MSG(p);
+	    vim_free(p);
+	}
+	else
+	    MSG("default");
+#else
+	MSG(_("unknown"));
+#endif
+    }
+    else if (load_colors(eap->arg) == FAIL)
 	EMSG2(_("E185: Cannot find color scheme %s"), eap->arg);
 }
 
--- a/src/version.c
+++ b/src/version.c
@@ -682,6 +682,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    424,
+/**/
     423,
 /**/
     422,