[geany/geany] f3af82: Handle failure of reading named style by trying to read it as a named color

Matthew Brush git-noreply at xxxxx
Thu Jul 26 00:02:29 UTC 2012


Branch:      refs/heads/document-messages
Author:      Matthew Brush <matt at geany.org>
Committer:   Matthew Brush <matt at geany.org>
Date:        Mon, 26 Dec 2011 00:40:18
Commit:      f3af82d40df3503495445c4f25bf7cbeda6d839e
             https://github.com/geany/geany/commit/f3af82d40df3503495445c4f25bf7cbeda6d839e

Log Message:
-----------
Handle failure of reading named style by trying to read it as a named color

TODO: find a better way to handle this and restore the removed warning


Modified Paths:
--------------
    src/highlighting.c

Modified: src/highlighting.c
31 files changed, 15 insertions(+), 16 deletions(-)
===================================================================
@@ -271,26 +271,25 @@ static void parse_keyfile_style(GKeyFile *kf, gchar **list,
 	len = g_strv_length(list);
 
 	str = list[0];
+
+	/* It might be a named style so try and parse it as such */
 	if (len == 1 && isalpha(str[0]))
 	{
-		if (!read_named_style(str, style))
-			geany_debug(
-				"No named style '%s'! Check filetype styles or %s color scheme.",
-				str, NVL(editor_prefs.color_scheme, "filetypes.common"));
+		if (read_named_style(str, style))
+			return;
+		/* It must start with a named color (or error), fall through */
 	}
-	else
+
+	switch (len)
 	{
-		switch (len)
-		{
-			case 4:
-				style->italic = utils_atob(list[3]);
-			case 3:
-				style->bold = utils_atob(list[2]);
-			case 2:
-				parse_color(kf, list[1], &style->background);
-			case 1:
-				parse_color(kf, list[0], &style->foreground);
-		}
+		case 4:
+			style->italic = utils_atob(list[3]);
+		case 3:
+			style->bold = utils_atob(list[2]);
+		case 2:
+			parse_color(kf, list[1], &style->background);
+		case 1:
+			parse_color(kf, list[0], &style->foreground);
 	}
 }
 


@@ Diff output truncated at 100000 characters. @@


--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).



More information about the Commits mailing list