commit - 42a2230c34c2c687f7240566e9a9192a4a7f6f47
commit + 3e13595003634037ff26696ce7a32545721bfc24
blob - 1752dad3eccced99c1284defaff88b7339c4ca8a
blob + dcec3b8db7f80bdbe871e35ab38c736bbfb705f6
--- tog/tog.c
+++ tog/tog.c
}
static void
-log_scroll_up(struct tog_view *view, int maxscroll)
+log_scroll_up(struct tog_log_view_state *s, int maxscroll)
{
- struct tog_log_view_state *s = &view->state.log;
struct commit_queue_entry *entry;
int nscrolled = 0;
if (s->selected > 0)
s->selected--;
else
- log_scroll_up(view, 1);
+ log_scroll_up(s, 1);
break;
case KEY_PPAGE:
case CTRL('b'):
s->selected = 0;
break;
}
- log_scroll_up(view, view->nlines - 1);
+ log_scroll_up(s, view->nlines - 1);
break;
case 'j':
case KEY_DOWN:
}
static void
-tree_scroll_up(struct tog_view *view, int maxscroll)
+tree_scroll_up(struct tog_tree_view_state *s, int maxscroll)
{
- struct tog_tree_view_state *s = &view->state.tree;
struct got_tree_entry *te;
int isroot = s->tree == s->root;
int i = 0;
}
static void
-tree_scroll_down(struct tog_view *view, int maxscroll)
+tree_scroll_down(struct tog_tree_view_state *s, int maxscroll)
{
- struct tog_tree_view_state *s = &view->state.tree;
struct got_tree_entry *next, *last;
int n = 0;
s->selected--;
break;
}
- tree_scroll_up(view, 1);
+ tree_scroll_up(s, 1);
break;
case KEY_PPAGE:
case CTRL('b'):
if (s->first_displayed_entry == NULL)
s->selected = 0;
}
- tree_scroll_up(view, MAX(0, view->nlines - 3));
+ tree_scroll_up(s, MAX(0, view->nlines - 3));
break;
case 'j':
case KEY_DOWN:
== NULL)
/* can't scroll any further */
break;
- tree_scroll_down(view, 1);
+ tree_scroll_down(s, 1);
break;
case KEY_NPAGE:
case CTRL('f'):
s->selected = s->ndisplayed - 1;
break;
}
- tree_scroll_down(view, view->nlines - 3);
+ tree_scroll_down(s, view->nlines - 3);
break;
case KEY_ENTER:
case '\r':
}
static void
-ref_scroll_up(struct tog_view *view, int maxscroll)
+ref_scroll_up(struct tog_ref_view_state *s, int maxscroll)
{
- struct tog_ref_view_state *s = &view->state.ref;
struct tog_reflist_entry *re;
int i = 0;
}
static void
-ref_scroll_down(struct tog_view *view, int maxscroll)
+ref_scroll_down(struct tog_ref_view_state *s, int maxscroll)
{
- struct tog_ref_view_state *s = &view->state.ref;
struct tog_reflist_entry *next, *last;
int n = 0;
s->selected--;
break;
}
- ref_scroll_up(view, 1);
+ ref_scroll_up(s, 1);
break;
case KEY_PPAGE:
case CTRL('b'):
if (s->first_displayed_entry == TAILQ_FIRST(&s->refs))
s->selected = 0;
- ref_scroll_up(view, MAX(0, view->nlines - 1));
+ ref_scroll_up(s, MAX(0, view->nlines - 1));
break;
case 'j':
case KEY_DOWN:
if (TAILQ_NEXT(s->last_displayed_entry, entry) == NULL)
/* can't scroll any further */
break;
- ref_scroll_down(view, 1);
+ ref_scroll_down(s, 1);
break;
case KEY_NPAGE:
case CTRL('f'):
s->selected = s->ndisplayed - 1;
break;
}
- ref_scroll_down(view, view->nlines - 1);
+ ref_scroll_down(s, view->nlines - 1);
break;
case CTRL('l'):
ref_view_free_refs(s);