From a4c2eaa2e61bba9e479bc2649870d887d23ce119 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Wed, 22 Feb 2017 13:05:24 -0600 Subject: [PATCH] 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. --- src/move.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/move.c b/src/move.c index 883e41b3..ba68a711 100644 --- 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