summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2b42e5d)
raw | patch | inline | side by side (parent: 2b42e5d)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 11 Sep 2006 23:30:17 +0000 (01:30 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Mon, 11 Sep 2006 23:30:17 +0000 (01:30 +0200) |
Hopefully the last of all this sloppy bug fixing of the recent cleanups.
tig.c | patch | blob | history |
index 384fe213809795fde80895612896ce9f25d927ed..398f777a8608803dde95a51fc38846df4e3404bf 100644 (file)
--- a/tig.c
+++ b/tig.c
static void
move_view(struct view *view, enum request request)
{
- bool scroll = FALSE;
+ int scroll_steps = 0;
int steps;
switch (request) {
/* Check whether the view needs to be scrolled */
if (view->lineno < view->offset ||
view->lineno >= view->offset + view->height) {
+ scroll_steps = steps;
if (steps < 0 && -steps > view->offset) {
- steps = -view->offset;
+ scroll_steps = -view->offset;
} else if (steps > 0) {
if (view->lineno == view->lines - 1 &&
view->lines > view->height) {
- steps = view->lines - view->offset - 1;
- if (steps >= view->height)
- steps -= view->height - 1;
+ scroll_steps = view->lines - view->offset - 1;
+ if (scroll_steps >= view->height)
+ scroll_steps -= view->height - 1;
}
}
-
- scroll = TRUE;
}
if (!view_is_displayed(view)) {
if (ABS(steps) < view->height)
draw_view_line(view, view->lineno - steps - view->offset);
- if (scroll) {
- do_scroll_view(view, steps);
+ if (scroll_steps) {
+ do_scroll_view(view, scroll_steps);
return;
}