diff options
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_text/space_text.c | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 1eea035ec2c..ebe2d21826f 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -2370,7 +2370,11 @@ static char tab_to_spaces[] = " "; static void txt_convert_tab_to_spaces (Text *text) { - char *sb = &tab_to_spaces[text->curl->len % TXT_TABSIZE]; + /* sb aims to pad adjust the tab-width needed so that the right number of spaces + * is added so that the indention of the line is the right width (i.e. aligned + * to multiples of TXT_TABSIZE) + */ + char *sb = &tab_to_spaces[text->curc % TXT_TABSIZE]; txt_insert_buf(text, sb); } diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 77e0efafd0b..52f86d5fd98 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -311,6 +311,7 @@ static void text_keymap(struct wmKeyConfig *keyconf) RNA_int_set(WM_keymap_add_item(keymap, "TEXT_OT_scroll", WHEELDOWNMOUSE, KM_PRESS, 0, 0)->ptr, "lines", 1); WM_keymap_add_item(keymap, "TEXT_OT_line_break", RETKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "TEXT_OT_line_break", PADENTER, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "TEXT_OT_line_number", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); WM_keymap_add_item(keymap, "TEXT_OT_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last! |