diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-01 04:15:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-01 04:15:22 +0400 |
commit | 9e75d276e31caa581ad14f4561aed03c57e2b2c9 (patch) | |
tree | d9ed28d32d834514c36ad24b0dc667dc60731d51 /source/blender/editors/space_text/text_ops.c | |
parent | 04234c5287d10fa0dea381c5032e47bd9a48ee3f (diff) |
holding ctrl when using arrow keys in the text editor didn't navigate newlines.
Diffstat (limited to 'source/blender/editors/space_text/text_ops.c')
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index fec6847bb79..30f3c1623c9 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1855,10 +1855,16 @@ static int text_move_cursor(bContext *C, int type, int select) break; case PREV_WORD: + if (txt_cursor_is_line_start(text)) { + txt_move_left(text, select); + } txt_jump_left(text, select, true); break; case NEXT_WORD: + if (txt_cursor_is_line_end(text)) { + txt_move_right(text, select); + } txt_jump_right(text, select, true); break; @@ -2005,14 +2011,24 @@ static int text_delete_exec(bContext *C, wmOperator *op) text_drawcache_tag_update(CTX_wm_space_text(C), 0); - if (type == DEL_PREV_WORD) + if (type == DEL_PREV_WORD) { + if (txt_cursor_is_line_start(text)) { + txt_backspace_char(text); + } txt_backspace_word(text); - else if (type == DEL_PREV_CHAR) + } + else if (type == DEL_PREV_CHAR) { txt_backspace_char(text); - else if (type == DEL_NEXT_WORD) + } + else if (type == DEL_NEXT_WORD) { + if (txt_cursor_is_line_end(text)) { + txt_delete_char(text); + } txt_delete_word(text); - else if (type == DEL_NEXT_CHAR) + } + else if (type == DEL_NEXT_CHAR) { txt_delete_char(text); + } text_update_line_edited(text->curl); |