tweak do_next_word() and do_prev_word() to make sure they don't parse
the same multibyte character twice git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2274 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
ce0451348c
commit
776cf3771d
|
@ -1344,6 +1344,9 @@ void do_next_word(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move forward until we find the first letter of the next word. */
|
/* Move forward until we find the first letter of the next word. */
|
||||||
|
if (current->data[current_x] != '\0')
|
||||||
|
current_x += char_mb_len;
|
||||||
|
|
||||||
for (; current != NULL; current = current->next) {
|
for (; current != NULL; current = current->next) {
|
||||||
while (current->data[current_x] != '\0') {
|
while (current->data[current_x] != '\0') {
|
||||||
char_mb_len = parse_mbchar(current->data + current_x,
|
char_mb_len = parse_mbchar(current->data + current_x,
|
||||||
|
@ -1416,6 +1419,11 @@ void do_prev_word(void)
|
||||||
|
|
||||||
/* Move backward until we find the last letter of the previous
|
/* Move backward until we find the last letter of the previous
|
||||||
* word. */
|
* word. */
|
||||||
|
if (current_x == 0)
|
||||||
|
begin_line = TRUE;
|
||||||
|
else
|
||||||
|
current_x = move_mbleft(current->data, current_x);
|
||||||
|
|
||||||
for (; current != NULL; current = current->prev) {
|
for (; current != NULL; current = current->prev) {
|
||||||
while (!begin_line) {
|
while (!begin_line) {
|
||||||
char_mb_len = parse_mbchar(current->data + current_x,
|
char_mb_len = parse_mbchar(current->data + current_x,
|
||||||
|
|
Loading…
Reference in New Issue