From 67e48ac5f5b8a2333710625cb782f840dba27079 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Thu, 18 May 2006 10:15:09 +0200 Subject: [PATCH] Pressing Enter in the diff view will now scroll it one line down Make tig more compatible with Mutt behavior. Requested-by: Aneesh Kumar --- tig.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tig.c b/tig.c index 9c26656..da2af8f 100644 --- a/tig.c +++ b/tig.c @@ -68,7 +68,7 @@ static void set_nonblocking_input(bool loading); /* This color name can be used to refer to the default term colors. */ #define COLOR_DEFAULT (-1) -#define TIG_HELP "(d)iff, (l)og, (m)ain, (q)uit, (h)elp, (Enter) show diff" +#define TIG_HELP "(d)iff, (l)og, (m)ain, (q)uit, (h)elp" /* The format and size of the date column in the main view. */ #define DATE_FORMAT "%Y-%m-%d %H:%M" @@ -1521,6 +1521,11 @@ pager_enter(struct view *view) { char *line = view->line[view->lineno]; + if (view == VIEW(REQ_VIEW_DIFF)) { + scroll_view(view, REQ_SCROLL_LINE_DOWN); + return TRUE; + } + if (get_line_type(line) == LINE_COMMIT) { if (view == VIEW(REQ_VIEW_LOG)) open_view(view, REQ_VIEW_DIFF, OPEN_SPLIT | OPEN_BACKGROUNDED); @@ -1760,10 +1765,11 @@ static struct keymap keymap[] = { * Switch to pager view. * h:: * Show man page. - * Return:: - * If on a commit line show the commit diff. Additionally, if in - * main or log view this will split the view. To open the commit - * diff in full size view either use 'd' or press Return twice. + * Enter:: + * This key is "context sensitive" depending on what view you are + * currently in. When in log view on a commit line or in the main + * view, split the view and show the commit diff. In the diff view + * pressing Enter will simply scroll the view one line down. * Tab:: * Switch to next view. **/ -- 2.30.2