From 62331fd0f84425e2f7b1c3239f7fb000910dfbb6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 22 Nov 2012 09:49:56 +0000 Subject: fix for clear line adjusting console selection. --- source/blender/editors/space_console/console_ops.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_console') diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index d3ae5373a18..1a9f6c177b2 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -157,10 +157,9 @@ static ConsoleLine *console_lb_add__internal(ListBase *lb, ConsoleLine *from) ConsoleLine *ci = MEM_callocN(sizeof(ConsoleLine), "ConsoleLine Add"); if (from) { - ci->line = BLI_strdup(from->line); - ci->len = strlen(ci->line); - ci->len_alloc = ci->len; - + BLI_assert(strlen(from->line) == from->len); + ci->line = BLI_strdupn(from->line, from->len); + ci->len = ci->len_alloc = from->len; ci->cursor = from->cursor; ci->type = from->type; } @@ -625,6 +624,7 @@ static int console_clear_line_exec(bContext *C, wmOperator *UNUSED(op)) console_history_add(C, ci); console_history_add(C, NULL); + console_select_offset(sc, -ci->len); console_textview_update_rect(sc, ar); -- cgit v1.2.3