nano

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

commit d66ea08473b60b86803fa1e0439ba5f08ca37186
parent 8476bf86a18f01511bb9247836f65780c7042365
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Tue, 18 Oct 2016 11:46:15 +0200

moving: adjust the Y position to correspond with the changed X position

So the softwrap code in do_down() can compute the correct amount to scroll.

This fixes https://savannah.gnu.org/bugs/?49374.

Diffstat:
Msrc/move.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/move.c b/src/move.c @@ -582,8 +582,13 @@ void do_right(void) if (openfile->current->data[openfile->current_x] != '\0') openfile->current_x = move_mbright(openfile->current->data, openfile->current_x); - else if (openfile->current != openfile->filebot) + else if (openfile->current != openfile->filebot) { openfile->current_x = 0; +#ifndef NANO_TINY + if (ISSET(SOFTWRAP)) + openfile->current_y -= strlenpt(openfile->current->data) / COLS; +#endif + } openfile->placewewant = xplustabs();