1
1

moving: always account for the margin when in line numbering mode

Like do_down() does already, do_pageup() and do_right() should use
editwincols instead of COLS.

This addresses https://savannah.gnu.org/bugs/?49796.
Этот коммит содержится в:
David Lawrence Ramsey 2016-12-07 12:33:25 -06:00 коммит произвёл Benno Schulenberg
родитель 84d6f1a5b6
Коммит 6263416355

Просмотреть файл

@ -81,7 +81,7 @@ void do_page_up(void)
openfile->current = openfile->current->prev; openfile->current = openfile->current->prev;
#ifndef NANO_TINY #ifndef NANO_TINY
if (ISSET(SOFTWRAP) && openfile->current) { if (ISSET(SOFTWRAP) && openfile->current) {
skipped += strlenpt(openfile->current->data) / COLS; skipped += strlenpt(openfile->current->data) / editwincols;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "do_page_up: i = %d, skipped = %d based on line %ld len %lu\n", fprintf(stderr, "do_page_up: i = %d, skipped = %d based on line %ld len %lu\n",
i, skipped, (long)openfile->current->lineno, (unsigned long)strlenpt(openfile->current->data)); i, skipped, (long)openfile->current->lineno, (unsigned long)strlenpt(openfile->current->data));
@ -593,7 +593,7 @@ void do_right(void)
openfile->current_x = 0; openfile->current_x = 0;
#ifndef NANO_TINY #ifndef NANO_TINY
if (ISSET(SOFTWRAP)) if (ISSET(SOFTWRAP))
openfile->current_y -= strlenpt(openfile->current->data) / COLS; openfile->current_y -= strlenpt(openfile->current->data) / editwincols;
#endif #endif
} }