Changeset fa23002 for viewwin.c


Ignore:
Timestamp:
Sep 18, 2010, 5:07:39 PM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
9116936
Parents:
d574d61
git-author:
David Benjamin <davidben@mit.edu> (08/01/10 14:55:49)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 17:07:39)
Message:
Never move the screen up when during an owl_viewwin_down

We already can get in such a state, and a searchable popwin will be even
easier. Mimic less's behavior here.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • viewwin.c

    rd574d61 rfa23002  
    119119  int winlines;
    120120  owl_window_get_position(v->window, &winlines, 0, 0, 0);
    121   v->topline += amount;
    122   if ( (v->topline+winlines-BOTTOM_OFFSET) > v->textlines) {
    123     v->topline = v->textlines - winlines + BOTTOM_OFFSET;
    124   }
    125   owl_viewwin_dirty(v);
     121  /* Don't scroll past the bottom. */
     122  amount = MIN(amount, v->textlines - (v->topline + winlines - BOTTOM_OFFSET));
     123  /* But if we're already past the bottom, don't back up either. */
     124  if (amount > 0) {
     125    v->topline += amount;
     126    owl_viewwin_dirty(v);
     127  }
    126128}
    127129
Note: See TracChangeset for help on using the changeset viewer.