nano

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

commit 49fb755cfcc8cb95db08b7f59c74349633c3f3a7
parent 24a64d37dde2cacacd52896a3d3ef1193ddd5757
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 20 Aug 2017 16:00:05 +0200

moving: get <Up> unstuck when trying to pass over a sprawling tab

This is a temporary fix.  The resultant movement is erratic and
not what is desired (which is: to stay in the same screen column
as much as possible).

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

diff --git a/src/move.c b/src/move.c @@ -462,6 +462,7 @@ void do_end(void) void do_up(bool scroll_only) { filestruct *was_current = openfile->current; + size_t was_x = openfile->current_x; size_t was_column = xplustabs(); size_t leftedge, target_column; @@ -479,6 +480,8 @@ void do_up(bool scroll_only) openfile->placewewant = leftedge + target_column; openfile->current_x = proper_x(openfile->current->data, leftedge, actual_last_column(leftedge, target_column)); + if (openfile->current == was_current && openfile->current_x == was_x) + openfile->current_x--; /* 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