From: Jonas Fonseca Date: Tue, 29 May 2007 14:11:58 +0000 (+0200) Subject: Add notice about empty pager view X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5c4358d1b309381997a5c4780a432140fefa5bcb;p=tig.git 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. --- 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;