From 5568f99e97b0f79c1c4367fa14f6319f8dde6826 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Tue, 4 May 2010 20:01:58 -0400 Subject: [PATCH] Simplify handling of REQ_NEXT/REQ_PREVIOUS by using view->parent --- tig.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tig.c b/tig.c index f08117e..074e414 100644 --- a/tig.c +++ b/tig.c @@ -2320,9 +2320,6 @@ static struct view views[] = { #define view_is_displayed(view) \ (view == display[0] || view == display[1]) -#define view_has_parent(view, child_type, parent_type) \ - (view->type == child_type && view->parent && view->parent->type == parent_type) - static inline void set_view_attr(struct view *view, enum line_type type) { @@ -3695,11 +3692,7 @@ view_driver(struct view *view, enum request request) case REQ_PREVIOUS: request = request == REQ_NEXT ? REQ_MOVE_DOWN : REQ_MOVE_UP; - if (view_has_parent(view, VIEW_DIFF, VIEW_MAIN) || - view_has_parent(view, VIEW_DIFF, VIEW_BLAME) || - view_has_parent(view, VIEW_STAGE, VIEW_STATUS) || - view_has_parent(view, VIEW_BLOB, VIEW_TREE) || - view_has_parent(view, VIEW_MAIN, VIEW_BRANCH)) { + if (view->parent) { int line; view = view->parent; -- 2.30.2