pointer -> index for word movement iterators

This commit is contained in:
Daniel Micay 2012-09-09 16:59:51 -04:00
parent 74bf1c58ea
commit d0fca6953c
1 changed files with 4 additions and 4 deletions

View File

@ -222,8 +222,8 @@ static void move_backward(VteTerminal *vte, select_info *select, F predicate) {
bool in_word = false; bool in_word = false;
for (gunichar *c = codepoints + length - 2; c > codepoints; c--) { for (long i = length - 2; i > 0; i--) {
if (predicate(*(c - 1))) { if (predicate(codepoints[i - 1])) {
if (in_word) { if (in_word) {
break; break;
} }
@ -278,8 +278,8 @@ static void move_forward(VteTerminal *vte, select_info *select, F is_word) {
bool end_of_word = false; bool end_of_word = false;
for (gunichar *c = codepoints + 1; *c != 0; c++) { for (long i = 1; i < length; i++) {
if (is_word(*(c - 1))) { if (is_word(codepoints[i - 1])) {
if (end_of_word) { if (end_of_word) {
break; break;
} }