pointer -> index for word movement iterators
This commit is contained in:
parent
74bf1c58ea
commit
d0fca6953c
|
@ -222,8 +222,8 @@ static void move_backward(VteTerminal *vte, select_info *select, F predicate) {
|
|||
|
||||
bool in_word = false;
|
||||
|
||||
for (gunichar *c = codepoints + length - 2; c > codepoints; c--) {
|
||||
if (predicate(*(c - 1))) {
|
||||
for (long i = length - 2; i > 0; i--) {
|
||||
if (predicate(codepoints[i - 1])) {
|
||||
if (in_word) {
|
||||
break;
|
||||
}
|
||||
|
@ -278,8 +278,8 @@ static void move_forward(VteTerminal *vte, select_info *select, F is_word) {
|
|||
|
||||
bool end_of_word = false;
|
||||
|
||||
for (gunichar *c = codepoints + 1; *c != 0; c++) {
|
||||
if (is_word(*(c - 1))) {
|
||||
for (long i = 1; i < length; i++) {
|
||||
if (is_word(codepoints[i - 1])) {
|
||||
if (end_of_word) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue