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.master
parent
84d6f1a5b6
commit
6263416355
|
@ -81,7 +81,7 @@ void do_page_up(void)
|
|||
openfile->current = openfile->current->prev;
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP) && openfile->current) {
|
||||
skipped += strlenpt(openfile->current->data) / COLS;
|
||||
skipped += strlenpt(openfile->current->data) / editwincols;
|
||||
#ifdef DEBUG
|
||||
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));
|
||||
|
@ -593,7 +593,7 @@ void do_right(void)
|
|||
openfile->current_x = 0;
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP))
|
||||
openfile->current_y -= strlenpt(openfile->current->data) / COLS;
|
||||
openfile->current_y -= strlenpt(openfile->current->data) / editwincols;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue