LINE(AUTHOR, "author ", COLOR_CYAN, COLOR_DEFAULT, 0), \
LINE(COMMITTER, "committer ", COLOR_MAGENTA, COLOR_DEFAULT, 0), \
LINE(SIGNOFF, " Signed-off-by", COLOR_YELLOW, COLOR_DEFAULT, 0), \
+LINE(ACKED, " Acked-by", COLOR_YELLOW, COLOR_DEFAULT, 0), \
LINE(DEFAULT, "", COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL), \
LINE(CURSOR, "", COLOR_WHITE, COLOR_GREEN, A_BOLD), \
LINE(STATUS, "", COLOR_GREEN, COLOR_DEFAULT, 0), \
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;
}
static bool
tree_enter(struct view *view, struct line *line)
{
- enum open_flags flags = OPEN_DEFAULT;
+ enum open_flags flags = display[0] == view ? OPEN_SPLIT : OPEN_DEFAULT;
char *data = line->data;
enum request request;
break;
case LINE_TREE_FILE:
- /* This causes the blob view to become split, and not having it
- * in the tree dir case will make the blob view automatically
- * disappear when moving to a different directory. */
- flags |= OPEN_SPLIT;
request = REQ_VIEW_BLOB;
break;