1 | if (dx > 0) {↵ | | 1 | if (dx > 0) {↵
|
2 | if (offset >= con.limit)↵ | | 2 | if (offset >= con.limit)↵
|
3 | return -1;↵ | | 3 | return -1;↵
|
4 | int ch = target .charAt( offset ) ;↵ | | 4 | int ch = target .setIndex( offset ) ;↵
|
5 | if (isSet(opts, SINGLE_LINE)) {↵ | | 5 | if (isSet(opts, SINGLE_LINE)) {↵
|
6 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵ | | 6 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵
|
7 | offset ++;↵ | | 7 | offset ++;↵
|
8 | } else {↵ | | 8 | } else {↵
|
9 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵ | | 9 | if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)↵
|
10 | ch = REUtil.composeFromSurrogates(ch, target .charAt( ++offset ) );↵ | | 10 | ch = REUtil.composeFromSurrogates(ch, target .setIndex( ++offset ) );↵
|
11 | if (isEOLChar(ch))↵ | | 11 | if (isEOLChar(ch))↵
|
12 | return -1;↵ | | 12 | return -1;↵
|
13 | }↵ | | 13 | }↵
|
14 | offset ++;↵ | | 14 | offset ++;↵
|
15 | } else {↵ | | 15 | } else {↵
|
16 | int o1 = offset-1;↵ | | 16 | int o1 = offset-1;↵
|
17 | if (o1 >= con.limit || o1 < 0)↵ | | 17 | if (o1 >= con.limit || o1 < 0)↵
|
18 | return -1;↵ | | 18 | return -1;↵
|
19 | int ch = target .charAt( o1 ) ;↵ | | 19 | int ch = target .setIndex( o1 ) ;↵
|
20 | if (isSet(opts, SINGLE_LINE)) {↵ | | 20 | if (isSet(opts, SINGLE_LINE)) {↵
|
21 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | | 21 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵
|
22 | o1 --;↵ | | 22 | o1 --;↵
|
23 | } else {↵ | | 23 | } else {↵
|
24 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | | 24 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵
|
25 | ch = REUtil.composeFromSurrogates( target .charAt( --o1 ) , ch);↵ | | 25 | ch = REUtil.composeFromSurrogates( target .setIndex( --o1 ) , ch);↵
|
26 | if (!isEOLChar(ch))↵ | | 26 | if (!isEOLChar(ch))↵
|
27 | return -1;↵ | | 27 | return -1;↵
|
28 | }↵ | | 28 | }↵
|
29 | offset = o1;↵ | | 29 | offset = o1;↵
|
30 | | | 30 |
|