threads / patch / 34582

patchScroll diff with arrow keys in log view

Subject: [PATCH] Scroll diff with arrow keys in log view

## tl;dr

One message between Aug 1, 2013 and Aug 1, 2013. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Kumar Appaiah· Aug 1, 2013, 03:11 UTC · lore

This commit introduces the VIEW_NO_PARENT_NAV flag and adds it to the log view. This allows the scrolling commands to fall through from the pager to the diff when the diff is viewed in the log mode.

Signed-Off-By: Kumar Appaiah <a.kumar@alumni.iitm.ac.in>
---
 tig.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Show changes to tig.c +3 −2
diff --git a/tig.c b/tig.c
index 8301295..52831fd 100644
--- a/tig.c
+++ b/tig.c
@@ -1895,6 +1895,7 @@ enum view_flag {
 	VIEW_STDIN		= 1 << 8,
 	VIEW_SEND_CHILD_ENTER	= 1 << 9,
 	VIEW_FILE_FILTER	= 1 << 10,
+	VIEW_NO_PARENT_NAV      = 1 << 11,
 };
 
 #define view_has_flags(view, flag)	((view)->ops->flags & (flag))
@@ -3765,7 +3766,7 @@ view_driver(struct view *view, enum request request)
 
 	case REQ_NEXT:
 	case REQ_PREVIOUS:
-		if (view->parent) {
+		if (view->parent && !view_has_flags(view->parent, VIEW_NO_PARENT_NAV)) {
 			int line;
 
 			view = view->parent;
@@ -4431,7 +4432,7 @@ log_request(struct view *view, enum request request, struct line *line)
 static struct view_ops log_ops = {
 	"line",
 	{ "log" },
-	VIEW_ADD_PAGER_REFS | VIEW_OPEN_DIFF | VIEW_SEND_CHILD_ENTER,
+	VIEW_ADD_PAGER_REFS | VIEW_OPEN_DIFF | VIEW_SEND_CHILD_ENTER | VIEW_NO_PARENT_NAV,
 	0,
 	log_open,
 	pager_read,
-- 
1.8.3.2

← back to recent threads