From ab7ca2dc441239686bcc44189c79e377ba4d089c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Feb 2013 03:03:12 +0000 Subject: fix for double clicking in the text editor not working usefully (double clicking a pair chars would select 3 - one to the left). --- source/blender/editors/space_text/text_ops.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_text') diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 1f209f90007..b60528bcee8 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1312,9 +1312,11 @@ void TEXT_OT_select_line(wmOperatorType *ot) static int text_select_word_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text = CTX_data_edit_text(C); + /* don't advance cursor before stepping */ + const bool use_init_step = false; - txt_jump_left(text, 0); - txt_jump_right(text, 1); + txt_jump_left(text, false, use_init_step); + txt_jump_right(text, true, use_init_step); text_update_cursor_moved(C); WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text); @@ -1816,11 +1818,11 @@ static int text_move_cursor(bContext *C, int type, int select) break; case PREV_WORD: - txt_jump_left(text, select); + txt_jump_left(text, select, true); break; case NEXT_WORD: - txt_jump_right(text, select); + txt_jump_right(text, select, true); break; case PREV_CHAR: -- cgit v1.2.3