scrolling: use a comparison that will work also in softwrap mode

This fixes https://savannah.gnu.org/bugs/?49467.
master
Benno Schulenberg 2016-10-28 11:37:03 +02:00
parent 9c2e270b3e
commit 4c476bc872
1 changed files with 4 additions and 6 deletions

View File

@ -438,12 +438,10 @@ void do_up(bool scroll_only)
openfile->current_x = actual_x(openfile->current->data,
openfile->placewewant);
/* If scroll_only is FALSE and if we're on the first line of the
* edit window, scroll the edit window up one line if we're in
* smooth scrolling mode, or up half a page if we're not. If
* scroll_only is TRUE, scroll the edit window up one line
* unconditionally. */
if (openfile->current_y == 0 || scroll_only)
/* 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
* line if we're in smooth scrolling mode, and half a page otherwise. */
if (openfile->current->next == openfile->edittop || scroll_only)
edit_scroll(UPWARD, (ISSET(SMOOTH_SCROLL) || scroll_only) ?
1 : editwinrows / 2 + 1);