From acc05db50faa7323e32bab988b2f28e1bb05bc51 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 31 Dec 2012 14:49:27 +0000 Subject: minor updates to text autocomplete api - draw function wasn't lining up correctly since DPI edits - rename text_python.c to text_autocomplete.c --- source/blender/blenkernel/intern/suggestions.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/suggestions.c') diff --git a/source/blender/blenkernel/intern/suggestions.c b/source/blender/blenkernel/intern/suggestions.c index ff9774f85af..6f9736df683 100644 --- a/source/blender/blenkernel/intern/suggestions.c +++ b/source/blender/blenkernel/intern/suggestions.c @@ -163,13 +163,13 @@ void texttool_suggest_add(const char *name, char type) suggestions.top = 0; } -void texttool_suggest_prefix(const char *prefix) +void texttool_suggest_prefix(const char *prefix, const int prefix_len) { SuggItem *match, *first, *last; - int cmp, len = strlen(prefix), top = 0; + int cmp, top = 0; if (!suggestions.first) return; - if (len == 0) { + if (prefix_len == 0) { suggestions.selected = suggestions.firstmatch = suggestions.first; suggestions.lastmatch = suggestions.last; return; @@ -177,7 +177,7 @@ void texttool_suggest_prefix(const char *prefix) first = last = NULL; for (match = suggestions.first; match; match = match->next) { - cmp = txttl_cmp(prefix, match->name, len); + cmp = txttl_cmp(prefix, match->name, prefix_len); if (cmp == 0) { if (!first) { first = match; -- cgit v1.2.3