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).
master
Benno Schulenberg 2017-08-20 16:00:05 +02:00
parent 24a64d37dd
commit 49fb755cfc
1 changed files with 3 additions and 0 deletions

View File

@ -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