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:
authorSergey Sharybin <sergey.vfx@gmail.com>2010-12-17 23:24:13 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2010-12-17 23:24:13 +0300
commit96dfaa215c87cbbb4676d19b1f278997a52d47a1 (patch)
tree6a0826c0cdb9291f8deb917f17ab1ca0c4497153 /source/blender/editors/space_text
parent8b28c24d16386db7e68326d8607de5d20c9833b0 (diff)
Fix for moving caret to the line beginning/ending when word-wrapping is enabled
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/text_ops.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index c594fa7acc0..bcfcfd09fed 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -1541,6 +1541,7 @@ static void wrap_move_bol(SpaceText *st, ARegion *ar, short sel)
*charp= endj;
if(j>=oldc) {
+ if(ch=='\0') *charp= start;
loop= 0;
break;
}
@@ -1549,10 +1550,11 @@ static void wrap_move_bol(SpaceText *st, ARegion *ar, short sel)
start= end;
end += max;
- chop= 0;
+ chop= 1;
}
else if(ch==' ' || ch=='-' || ch=='\0') {
if(j>=oldc) {
+ *charp= start;
loop= 0;
break;
}
@@ -1603,17 +1605,18 @@ static void wrap_move_eol(SpaceText *st, ARegion *ar, short sel)
while(chars--) {
if(i-start>=max) {
+ if(chop) endj= j-1;
+
if(endj>=oldc) {
- *charp= endj;
+ if(ch=='\0') *charp= (*linep)->len;
+ else *charp= endj;
loop= 0;
break;
}
- if(chop) endj= j;
-
start= end;
end += max;
- chop= 0;
+ chop= 1;
} else if(ch=='\0') {
*charp= (*linep)->len;
loop= 0;