Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_text/text_autocomplete.c')
-rw-r--r--source/blender/editors/space_text/text_autocomplete.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c
index e406a1b7166..94977fc5f0f 100644
--- a/source/blender/editors/space_text/text_autocomplete.c
+++ b/source/blender/editors/space_text/text_autocomplete.c
@@ -167,7 +167,7 @@ static GHash *text_autocomplete_build(Text *text)
while (i_start < linep->len) {
/* seek identifier beginning */
- while (i_start < linep->len && !text_check_identifier(linep->line[i_start])) {
+ while (i_start < linep->len && !text_check_identifier_nodigit(linep->line[i_start])) {
i_start++;
}
i_end = i_start;
@@ -175,7 +175,11 @@ static GHash *text_autocomplete_build(Text *text)
i_end++;
}
- if (i_start != 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(linep->line[i_start - 1])))
+ {
char *str_sub = &linep->line[i_start];
const int choice_len = i_end - i_start;