aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-02-03 17:17:05 +0000
committerAndy Williams <andy@andywilliams.me>2017-02-03 17:17:05 +0000
commit9d0923e847ab1ec6a12360e9a5d8ea4b9bf6bd38 (patch)
tree9043049501e48828ffe5f198f6cd1a2db8089c63
parentelm_code: Add syntax highlighting for python (diff)
downloadefl-9d0923e847ab1ec6a12360e9a5d8ea4b9bf6bd38.tar.gz
elm_code: fix bugs in the highlighting of full line comments
@fix
-rw-r--r--src/lib/elementary/elm_code_syntax.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_code_syntax.c b/src/lib/elementary/elm_code_syntax.c
index 3d32e474f8..804dfb6c94 100644
--- a/src/lib/elementary/elm_code_syntax.c
+++ b/src/lib/elementary/elm_code_syntax.c
@@ -81,6 +81,8 @@ _content_starts_with(const char *content, const char *prefix, unsigned int lengt
unsigned int i;
unsigned int prefix_length;
+ if (!prefix)
+ return EINA_FALSE;
prefix_length = strlen(prefix);
if (!content || length < prefix_length)
return EINA_FALSE;
@@ -153,7 +155,7 @@ elm_code_syntax_parse_line(Elm_Code_Syntax *syntax, Elm_Code_Line *line)
break;
}
- elm_code_line_token_add(line, 1, i2, 1, ELM_CODE_TOKEN_TYPE_COMMENT);
+ elm_code_line_token_add(line, 0, i2, 1, ELM_CODE_TOKEN_TYPE_COMMENT);
if (i2 == length)
{
Elm_Code_Token *token = eina_list_last_data_get(line->tokens);