summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-01-22 21:59:45 +0000
committerAndy Williams <andy@andywilliams.me>2017-01-22 21:59:45 +0000
commit960812f658d1638aa26f8471e0f0d0dd2cced633 (patch)
tree744a911c7877b617b0d5c89efb7d40507158c550
parente4fef248987840ae95351119ce48b9855148a2cc (diff)
elm_code: Fix some syntax highlight after strings
-rw-r--r--src/lib/elementary/elm_code_syntax.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_code_syntax.c b/src/lib/elementary/elm_code_syntax.c
index a0f4a9e1ea..cd8a66f2ea 100644
--- a/src/lib/elementary/elm_code_syntax.c
+++ b/src/lib/elementary/elm_code_syntax.c
@@ -144,18 +144,19 @@ elm_code_syntax_parse_line(Elm_Code_Syntax *syntax, Elm_Code_Line *line)
144 return; 144 return;
145 } 145 }
146 i = i2 + 1; 146 i = i2 + 1;
147 // TODO reset all below of here
147 } 148 }
148 149
149 ptr = content; 150 ptr = content;
150 count = 0; 151 count = 0;
151 for (; i < length; i++) 152 for (; i < length; i++)
152 { 153 {
154 ptr = content + i - count;
153 if (_elm_code_text_char_is_whitespace(content[i])) 155 if (_elm_code_text_char_is_whitespace(content[i]))
154 { 156 {
155 if (count) 157 if (count)
156 _elm_code_syntax_parse_token(syntax, line, ptr-content, ptr, count); 158 _elm_code_syntax_parse_token(syntax, line, ptr-content, ptr, count);
157 159
158 ptr += count+1;
159 count = 0; 160 count = 0;
160 continue; 161 continue;
161 } 162 }
@@ -184,6 +185,7 @@ elm_code_syntax_parse_line(Elm_Code_Syntax *syntax, Elm_Code_Line *line)
184 { 185 {
185 Elm_Code_Token *token = eina_list_last_data_get(line->tokens); 186 Elm_Code_Token *token = eina_list_last_data_get(line->tokens);
186 token->continues = EINA_TRUE; 187 token->continues = EINA_TRUE;
188 // TODO reset all below of here
187 return; 189 return;
188 } 190 }
189 i = i2; 191 i = i2;
@@ -198,6 +200,7 @@ elm_code_syntax_parse_line(Elm_Code_Syntax *syntax, Elm_Code_Line *line)
198 end = i; 200 end = i;
199 201
200 elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING); 202 elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING);
203 count = 0;
201 continue; 204 continue;
202 } 205 }
203 else if (content[i] == '\'') 206 else if (content[i] == '\'')
@@ -208,6 +211,7 @@ elm_code_syntax_parse_line(Elm_Code_Syntax *syntax, Elm_Code_Line *line)
208 end = i; 211 end = i;
209 212
210 elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING); 213 elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING);
214 count = 0;
211 continue; 215 continue;
212 } 216 }
213 217
@@ -219,7 +223,6 @@ elm_code_syntax_parse_line(Elm_Code_Syntax *syntax, Elm_Code_Line *line)
219 223
220 elm_code_line_token_add(line, i, i, 1, ELM_CODE_TOKEN_TYPE_BRACE); 224 elm_code_line_token_add(line, i, i, 1, ELM_CODE_TOKEN_TYPE_BRACE);
221 225
222 ptr = content + i+1;
223 count = -1; 226 count = -1;
224 break; 227 break;
225 } 228 }