From 7ec4d5dedac4fb3dd74a648588f33861673ab28b Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 18 Oct 2016 15:44:02 +0200 Subject: [PATCH] Handle merge navigation in main view Handle merge ops in main view and emit a message when they are encountered outside. As per review: https://github.com/jonas/tig/pull/525#discussion_r83763350 --- src/main.c | 6 ++++++ src/tig.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index b3d0c0a5a..3850191b2 100644 --- a/src/main.c +++ b/src/main.c @@ -24,6 +24,7 @@ #include "tig/stage.h" #include "tig/main.h" #include "tig/diff.h" +#include "tig/search.h" /* * Main view backend @@ -536,6 +537,11 @@ main_request(struct view *view, enum request request, struct line *line) goto_id(view, "%(commit)^", true, false); break; + case REQ_MOVE_NEXT_MERGE: + case REQ_MOVE_PREV_MERGE: + find_merge(view, request); + break; + default: return request; } diff --git a/src/tig.c b/src/tig.c index 17554019f..89ef4a5f3 100644 --- a/src/tig.c +++ b/src/tig.c @@ -294,7 +294,7 @@ view_driver(struct view *view, enum request request) case REQ_MOVE_NEXT_MERGE: case REQ_MOVE_PREV_MERGE: - find_merge(view, request); + report("Moving between merge commits is not supported by the %s view", view->name); break; case REQ_STOP_LOADING: