From 5c4358d1b309381997a5c4780a432140fefa5bcb Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Tue, 29 May 2007 16:11:58 +0200 Subject: [PATCH] Add notice about empty pager view Similar to notice for blob view, mention when there is no pager content to view and suggest the user to open the prompt to run a command. --- tig.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tig.c b/tig.c index 45e47b9..4b4a8c2 100644 --- a/tig.c +++ b/tig.c @@ -2152,13 +2152,23 @@ view_driver(struct view *view, enum request request) get_key(REQ_VIEW_TREE)); break; } - /* Fall-through */ + open_view(view, request, OPEN_DEFAULT); + break; + + case REQ_VIEW_PAGER: + if (!VIEW(REQ_VIEW_PAGER)->lines) { + report("No pager content, press %s to run command from prompt", + get_key(REQ_PROMPT)); + break; + } + open_view(view, request, OPEN_DEFAULT); + break; + case REQ_VIEW_MAIN: case REQ_VIEW_DIFF: case REQ_VIEW_LOG: case REQ_VIEW_TREE: case REQ_VIEW_HELP: - case REQ_VIEW_PAGER: open_view(view, request, OPEN_DEFAULT); break; -- 2.30.2