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.
master
Benno Schulenberg 2016-10-18 11:46:15 +02:00
parent 8476bf86a1
commit d66ea08473
1 changed files with 6 additions and 1 deletions

View File

@ -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();