nano

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

commit a4c2eaa2e61bba9e479bc2649870d887d23ce119
parent 4d7735c8f99051f8868bbdffd5c42e81b353cb5d
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Wed, 22 Feb 2017 13:05:24 -0600

moving: make vertical movement account for varying chunk width

Use actual_last_column() to properly adjust the cursor if placewewant
is past the end of a softwrapped chunk.

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

diff --git a/src/move.c b/src/move.c @@ -88,7 +88,7 @@ void do_page_up(void) openfile->placewewant = leftedge + target_column; openfile->current_x = actual_x(openfile->current->data, - openfile->placewewant); + actual_last_column(leftedge, target_column)); /* Move the viewport so that the cursor stays immobile, if possible. */ adjust_viewport(STATIONARY); @@ -120,7 +120,7 @@ void do_page_down(void) openfile->placewewant = leftedge + target_column; openfile->current_x = actual_x(openfile->current->data, - openfile->placewewant); + actual_last_column(leftedge, target_column)); /* Move the viewport so that the cursor stays immobile, if possible. */ adjust_viewport(STATIONARY); @@ -480,7 +480,7 @@ void do_up(bool scroll_only) openfile->placewewant = leftedge + target_column; openfile->current_x = actual_x(openfile->current->data, - openfile->placewewant); + actual_last_column(leftedge, target_column)); /* When the cursor was on the first line of the edit window (or when just * scrolling without moving the cursor), scroll the edit window up -- one @@ -524,7 +524,7 @@ void do_down(bool scroll_only) openfile->placewewant = leftedge + target_column; openfile->current_x = actual_x(openfile->current->data, - openfile->placewewant); + actual_last_column(leftedge, target_column)); /* When the cursor was on the last line of the edit window (or when just * scrolling without moving the cursor), scroll the edit window down -- one