fix for double clicking in the text editor not working usefully (double clicking a pair chars would select 3 - one to the left).

This commit is contained in:
2013-02-14 03:03:12 +00:00
parent 12f6d3ad90
commit ab7ca2dc44
7 changed files with 37 additions and 29 deletions

View File

@@ -38,12 +38,12 @@
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_string_cursor_utf8.h"
#include "BLI_string_utf8.h"
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "BLI_fileops.h"
#include "DNA_constraint_types.h"
@@ -936,7 +936,7 @@ void txt_move_right(Text *text, short sel)
if (!sel) txt_pop_sel(text);
}
void txt_jump_left(Text *text, short sel)
void txt_jump_left(Text *text, bool sel, bool use_init_step)
{
TextLine **linep;
int *charp;
@@ -948,12 +948,12 @@ void txt_jump_left(Text *text, short sel)
BLI_str_cursor_step_utf8((*linep)->line, (*linep)->len,
charp, STRCUR_DIR_PREV,
STRCUR_JUMP_DELIM);
STRCUR_JUMP_DELIM, use_init_step);
if (!sel) txt_pop_sel(text);
}
void txt_jump_right(Text *text, short sel)
void txt_jump_right(Text *text, bool sel, bool use_init_step)
{
TextLine **linep;
int *charp;
@@ -965,7 +965,7 @@ void txt_jump_right(Text *text, short sel)
BLI_str_cursor_step_utf8((*linep)->line, (*linep)->len,
charp, STRCUR_DIR_NEXT,
STRCUR_JUMP_DELIM);
STRCUR_JUMP_DELIM, use_init_step);
if (!sel) txt_pop_sel(text);
}
@@ -2402,7 +2402,7 @@ void txt_delete_char(Text *text)
void txt_delete_word(Text *text)
{
txt_jump_right(text, 1);
txt_jump_right(text, true, true);
txt_delete_sel(text);
}
@@ -2451,7 +2451,7 @@ void txt_backspace_char(Text *text)
void txt_backspace_word(Text *text)
{
txt_jump_left(text, 1);
txt_jump_left(text, true, true);
txt_delete_sel(text);
}