diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-19 20:13:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-19 20:13:41 +0400 |
commit | 7f1ae2497b01dfc026564420605b492944d685a6 (patch) | |
tree | 89474941781de1342b68b38bf7bbdc360c0c697e /source/blender/python | |
parent | 91a63e347d3a0909786bc0f39cb0ccf53da9d92d (diff) |
fix [#34275] Text autocomplete cuts words with accents or special characters
autocomplete is now unicode aware, using python api's checks for now. eventually we should have our own.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 632018f2bf0..90199a403dc 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -928,3 +928,20 @@ static void bpy_module_free(void *UNUSED(mod)) } #endif + + +/* EVIL, define text.c functions here... */ +extern int text_check_identifier_unicode(const unsigned int ch); +extern int text_check_identifier_nodigit_unicode(const unsigned int ch); +extern int text_check_identifier(const char ch); +extern int text_check_identifier_nodigit(const char ch); + +int text_check_identifier_unicode(const unsigned int ch) +{ + return (ch < 255 && text_check_identifier((char)ch)) || Py_UNICODE_ISALNUM(ch); +} + +int text_check_identifier_nodigit_unicode(const unsigned int ch) +{ + return (ch < 255 && text_check_identifier_nodigit((char)ch)) || Py_UNICODE_ISALPHA(ch); +} |