From: Jonas Fonseca Date: Wed, 5 May 2010 00:01:58 +0000 (-0400) Subject: Simplify handling of REQ_NEXT/REQ_PREVIOUS by using view->parent X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5568f99e97b0f79c1c4367fa14f6319f8dde6826;p=tig.git Simplify handling of REQ_NEXT/REQ_PREVIOUS by using view->parent --- 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;