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:
authorCampbell Barton <ideasman42@gmail.com>2013-02-11 13:40:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-11 13:40:33 +0400
commit934fa91f75eaf5af46ed188dbf3ed50576acb81c (patch)
tree791f77a5f3b3affa61c767616a18eaebcc7473a1 /source/blender/editors/space_console/console_draw.c
parentfb01dcea5ff167b838e25f234029f93b690954dc (diff)
patch [#34192] UTF-8 input in Python interactive console
from Shinsuke Irie (irie)
Diffstat (limited to 'source/blender/editors/space_console/console_draw.c')
-rw-r--r--source/blender/editors/space_console/console_draw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c
index 22c260de1a1..c195cb39157 100644
--- a/source/blender/editors/space_console/console_draw.c
+++ b/source/blender/editors/space_console/console_draw.c
@@ -158,9 +158,9 @@ static int console_textview_line_color(struct TextViewContext *tvc, unsigned cha
if (tvc->iter_index == 0) {
const SpaceConsole *sc = (SpaceConsole *)tvc->arg1;
const ConsoleLine *cl = (ConsoleLine *)sc->history.last;
- const int prompt_len = strlen(sc->prompt);
- const int cursor_loc = cl->cursor + prompt_len;
- const int line_len = cl->len + prompt_len;
+ const int prompt_len = BLI_strlen_utf8(sc->prompt);
+ const int cursor_loc = BLI_strnlen_utf8(cl->line, cl->cursor) + prompt_len;
+ const int line_len = BLI_strlen_utf8(cl->line) + prompt_len;
int xy[2] = {CONSOLE_DRAW_MARGIN, CONSOLE_DRAW_MARGIN};
int pen[2];
xy[1] += tvc->lheight / 6;