index bee3ac2a2010d68b60a5460902f5f6ab365c69c2..413bd04b61a2766f7c1c6decde15fdfb578220fd 100644 (file)
--- a/tig.c
+++ b/tig.c
REQ_(PREVIOUS, "Move to previous"), \
REQ_(VIEW_NEXT, "Move focus to next view"), \
REQ_(REFRESH, "Reload and refresh"), \
+ REQ_(MAXIMIZE, "Maximize the current view"), \
REQ_(VIEW_CLOSE, "Close the current view"), \
REQ_(QUIT, "Close all views and quit"), \
\
{ KEY_UP, REQ_PREVIOUS },
{ KEY_DOWN, REQ_NEXT },
{ 'R', REQ_REFRESH },
+ { 'M', REQ_MAXIMIZE },
/* Cursor navigation */
{ 'k', REQ_MOVE_UP },
VIEW_(STAGE, "stage", &stage_ops, TRUE, ""),
};
-#define VIEW(req) (&views[(req) - REQ_OFFSET - 1])
+#define VIEW(req) (&views[(req) - REQ_OFFSET - 1])
+#define VIEW_REQ(view) ((view) - views + REQ_OFFSET + 1)
#define foreach_view(view, i) \
for (i = 0; i < ARRAY_SIZE(views) && (view = &views[i]); i++)
report("Refreshing is not yet supported for the %s view", view->name);
break;
+ case REQ_MAXIMIZE:
+ if (displayed_views() == 2)
+ open_view(view, VIEW_REQ(view), OPEN_DEFAULT);
+ break;
+
case REQ_TOGGLE_LINENO:
opt_line_number = !opt_line_number;
redraw_display();