nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 626341635537899f73b369d444bfea1b9d7c1cb7
parent 84d6f1a5b6e4f2b37acf16ff1d7f128fd60c0355
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Wed,  7 Dec 2016 12:33:25 -0600

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.

Diffstat:
Msrc/move.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/move.c b/src/move.c @@ -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 }