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:
Diffstat (limited to 'source/blender/editors/space_console/console_ops.c')
-rw-r--r--source/blender/editors/space_console/console_ops.c46
1 files changed, 21 insertions, 25 deletions
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index 981e056fa63..f0d4a45a3dd 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -287,12 +287,11 @@ static bool console_line_column_from_index(
*r_col = offset - pos;
return true;
}
- else {
- *r_cl = NULL;
- *r_cl_offset = -1;
- *r_col = -1;
- return false;
- }
+
+ *r_cl = NULL;
+ *r_cl_offset = -1;
+ *r_col = -1;
+ return false;
}
/* static funcs for text editing */
@@ -403,9 +402,8 @@ static int console_insert_exec(bContext *C, wmOperator *op)
if (len == 0) {
return OPERATOR_CANCELLED;
}
- else {
- console_select_offset(sc, len);
- }
+
+ console_select_offset(sc, len);
console_textview_update_rect(sc, region);
ED_area_tag_redraw(CTX_wm_area(C));
@@ -426,21 +424,20 @@ static int console_insert_invoke(bContext *C, wmOperator *op, const wmEvent *eve
if ((event->ctrl || event->oskey) && !event->utf8_buf[0]) {
return OPERATOR_PASS_THROUGH;
}
- else {
- char str[BLI_UTF8_MAX + 1];
- size_t len;
- if (event->utf8_buf[0]) {
- len = BLI_str_utf8_size_safe(event->utf8_buf);
- memcpy(str, event->utf8_buf, len);
- }
- else {
- /* in theory, ghost can set value to extended ascii here */
- len = BLI_str_utf8_from_unicode(event->ascii, str);
- }
- str[len] = '\0';
- RNA_string_set(op->ptr, "text", str);
+ char str[BLI_UTF8_MAX + 1];
+ size_t len;
+
+ if (event->utf8_buf[0]) {
+ len = BLI_str_utf8_size_safe(event->utf8_buf);
+ memcpy(str, event->utf8_buf, len);
+ }
+ else {
+ /* in theory, ghost can set value to extended ascii here */
+ len = BLI_str_utf8_from_unicode(event->ascii, str);
}
+ str[len] = '\0';
+ RNA_string_set(op->ptr, "text", str);
}
return console_insert_exec(C, op);
}
@@ -674,9 +671,8 @@ static int console_delete_exec(bContext *C, wmOperator *op)
if (!done) {
return OPERATOR_CANCELLED;
}
- else {
- console_select_offset(sc, -stride);
- }
+
+ console_select_offset(sc, -stride);
console_textview_update_rect(sc, region);
ED_area_tag_redraw(CTX_wm_area(C));