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:
authorCampbell Barton <ideasman42@gmail.com>2012-03-07 17:35:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-07 17:35:32 +0400
commit41bdcc7e4e3409efefd9b591b86605d4f7fdff5d (patch)
treefe08b5c05b5eb83d387083ea692832e26a8ceefd /source/blender
parentcb45a5bbb08a7878f0cd14781ed84ac42e1349ad (diff)
tweak text delimiters for button ctrl + left/right, ctrl+backspace/del
now theres always a single step before skipping delimiters, this means the skipping actions always advance by more then 1 char (which matches the text editor).
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_handlers.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 0496c8c5c36..3d9295b479a 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1329,37 +1329,35 @@ static void ui_textedit_step_utf8(const char *str, size_t maxlen,
{
const short pos_prev= *pos;
- if(direction) { /* right*/
- if(jump != BUTTON_EDIT_JUMP_NONE) {
+ if (direction) { /* right */
+ ui_textedit_step_next_utf8(str, maxlen, pos);
+
+ if (jump != BUTTON_EDIT_JUMP_NONE) {
const uiButtonDelimType is_special= (*pos) < maxlen ? test_special_char(str[(*pos)]) : BUTTON_DELIM_NONE;
/* jump between special characters (/,\,_,-, etc.),
* look at function test_special_char() for complete
* list of special character, ctr -> */
- while((*pos) < maxlen) {
+ while ((*pos) < maxlen) {
if (ui_textedit_step_next_utf8(str, maxlen, pos)) {
- if((jump != BUTTON_EDIT_JUMP_ALL) && (is_special != test_special_char(str[(*pos)]))) break;
+ if ((jump != BUTTON_EDIT_JUMP_ALL) && (is_special != test_special_char(str[(*pos)]))) break;
}
else {
break; /* unlikely but just incase */
}
}
}
- else {
- ui_textedit_step_next_utf8(str, maxlen, pos);
- }
}
else { /* left */
+ ui_textedit_step_prev_utf8(str, maxlen, pos);
+
if(jump != BUTTON_EDIT_JUMP_NONE) {
const uiButtonDelimType is_special= (*pos) > 1 ? test_special_char(str[(*pos) - 1]) : BUTTON_DELIM_NONE;
- /* left only: compensate for index/change in direction */
- ui_textedit_step_prev_utf8(str, maxlen, pos);
-
/* jump between special characters (/,\,_,-, etc.),
* look at function test_special_char() for complete
* list of special character, ctr -> */
while ((*pos) > 0) {
if (ui_textedit_step_prev_utf8(str, maxlen, pos)) {
- if((jump != BUTTON_EDIT_JUMP_ALL) && (is_special != test_special_char(str[(*pos)]))) break;
+ if ((jump != BUTTON_EDIT_JUMP_ALL) && (is_special != test_special_char(str[(*pos)]))) break;
}
else {
break;
@@ -1367,13 +1365,10 @@ static void ui_textedit_step_utf8(const char *str, size_t maxlen,
}
/* left only: compensate for index/change in direction */
- if(((*pos) != 0) && ABS(pos_prev - (*pos)) > 1) {
+ if (((*pos) != 0) && ABS(pos_prev - (*pos)) >= 1) {
ui_textedit_step_next_utf8(str, maxlen, pos);
}
}
- else {
- ui_textedit_step_prev_utf8(str, maxlen, pos);
- }
}
}