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:
authorJason Wilkins <Jason.A.Wilkins@gmail.com>2012-11-27 05:18:54 +0400
committerJason Wilkins <Jason.A.Wilkins@gmail.com>2012-11-27 05:18:54 +0400
commitff7c690e4064bbb1d6180668625d7b414000e9ea (patch)
tree4ac96ca8ed5a4e6a7ab1104d0271aba02266ace6 /source/blender/editors/space_console/console_ops.c
parent6b65102c20e9bdafd90f55f60c2a2084d873e809 (diff)
parent9b32776be349f5e738b449ca1298e65ce1b69d33 (diff)
Merge w/ trunk: r52086-r52534 (As with last time, the game engine was not merged)soc-2012-swiss_cheese
Diffstat (limited to 'source/blender/editors/space_console/console_ops.c')
-rw-r--r--source/blender/editors/space_console/console_ops.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index d3ae5373a18..bb46135545c 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;
}
@@ -174,10 +173,8 @@ static ConsoleLine *console_lb_add__internal(ListBase *lb, ConsoleLine *from)
return ci;
}
-static ConsoleLine *console_history_add(const bContext *C, ConsoleLine *from)
+static ConsoleLine *console_history_add(SpaceConsole *sc, ConsoleLine *from)
{
- SpaceConsole *sc = CTX_wm_space_console(C);
-
return console_lb_add__internal(&sc->history, from);
}
@@ -217,7 +214,7 @@ ConsoleLine *console_history_verify(const bContext *C)
SpaceConsole *sc = CTX_wm_space_console(C);
ConsoleLine *ci = sc->history.last;
if (ci == NULL)
- ci = console_history_add(C, NULL);
+ ci = console_history_add(sc, NULL);
return ci;
}
@@ -623,8 +620,9 @@ static int console_clear_line_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
}
- console_history_add(C, ci);
- console_history_add(C, NULL);
+ console_history_add(sc, ci);
+ console_history_add(sc, NULL);
+ console_select_offset(sc, -ci->len);
console_textview_update_rect(sc, ar);
@@ -727,7 +725,7 @@ static int console_history_cycle_exec(bContext *C, wmOperator *op)
while ((cl = console_history_find(sc, ci->line, ci)))
console_history_free(sc, cl);
- console_history_add(C, (ConsoleLine *)sc->history.last);
+ console_history_add(sc, (ConsoleLine *)sc->history.last);
}
ci = sc->history.last;