From 54311fde29aef9494a6b752786a8d5476867a174 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 Feb 2013 13:41:53 +0000 Subject: revert own commit r54625, broke autocomplete. --- .../blender/editors/space_text/text_autocomplete.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'source/blender/editors/space_text') diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c index 62e5728bd3c..94977fc5f0f 100644 --- a/source/blender/editors/space_text/text_autocomplete.c +++ b/source/blender/editors/space_text/text_autocomplete.c @@ -162,28 +162,23 @@ static GHash *text_autocomplete_build(Text *text) gh = BLI_ghash_str_new(__func__); for (linep = text->lines.first; linep; linep = linep->next) { - size_t i_start = 0; - size_t i_end = 0; - size_t i_step = 0; + int i_start = 0; + int i_end = 0; while (i_start < linep->len) { /* seek identifier beginning */ - while ((i_start < linep->len) && - (!text_check_identifier_nodigit(BLI_str_utf8_as_unicode_step(&linep->line[i_start], &i_step)))) - { - i_start = i_step; + while (i_start < linep->len && !text_check_identifier_nodigit(linep->line[i_start])) { + i_start++; } i_end = i_start; - while ((i_end < linep->len) && - (!text_check_identifier(BLI_str_utf8_as_unicode_step(&linep->line[i_end], &i_step)))) - { - i_end = i_step; + while (i_end < linep->len && text_check_identifier(linep->line[i_end])) { + i_end++; } if ((i_start != i_end) && /* check we're at the beginning of a line or that the previous char is not an identifier - * this prevents digits from being added */ - ((i_start < 1) || !text_check_identifier(BLI_str_utf8_as_unicode(&linep->line[i_start - 1])))) + * this prevents digits from being added */ + ((i_start < 1) || !text_check_identifier(linep->line[i_start - 1]))) { char *str_sub = &linep->line[i_start]; const int choice_len = i_end - i_start; -- cgit v1.2.3