summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d9d1c72)
raw | patch | inline | side by side (parent: d9d1c72)
author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 19 May 2006 20:19:19 +0000 (22:19 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Fri, 19 May 2006 20:19:19 +0000 (22:19 +0200) |
If only one view is open it will quit. More compatible with Mutt behavior.
Based on patch by Aneesh Kumar <aneesh.kumar@gmail.com>
Based on patch by Aneesh Kumar <aneesh.kumar@gmail.com>
tig.c | patch | blob | history |
index 901994753621f99dbcaf39d4b42f6c928ea841af..ca57f75ca25b8b9408adf91a5049bce21e0ef213 100644 (file)
--- a/tig.c
+++ b/tig.c
REQ_STOP_LOADING,
REQ_TOGGLE_LINE_NUMBERS,
REQ_VIEW_NEXT,
+ REQ_VIEW_CLOSE,
REQ_MOVE_UP,
REQ_MOVE_UP_ENTER,
doupdate();
return TRUE;
+ case REQ_VIEW_CLOSE:
+ if (display[1]) {
+ view = display[(current_view + 1) % ARRAY_SIZE(display)];
+ memset(display, 0, sizeof(display));
+ current_view = 0;
+ display[current_view] = view;
+ resize_display();
+ redraw_display();
+ break;
+ }
+ /* Fall-through */
case REQ_QUIT:
return FALSE;
* Switch to pager view.
* h::
* Show man page.
+ * q::
+ * Close view if multiple views are open, else quit.
* 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
{ 'p', REQ_VIEW_PAGER },
{ 'h', REQ_VIEW_HELP },
+ { 'q', REQ_VIEW_CLOSE },
{ KEY_TAB, REQ_VIEW_NEXT },
{ KEY_RETURN, REQ_ENTER },