index 7130943ebc6ae5894585eb04a0b1bf1c450a929c..73c8b255a9d0a514b6802c88259611b895440e7e 100644 (file)
--- a/tig.c
+++ b/tig.c
REQ_(TOGGLE_REV_GRAPH, "Toggle revision graph visualization"), \
REQ_(STATUS_UPDATE, "Update file status"), \
REQ_(STATUS_MERGE, "Merge file using external tool"), \
+ REQ_(TREE_PARENT, "Switch to parent directory in tree view"), \
REQ_(EDIT, "Open in editor"), \
REQ_(NONE, "Do nothing")
{ ':', REQ_PROMPT },
{ 'u', REQ_STATUS_UPDATE },
{ 'M', REQ_STATUS_MERGE },
+ { ',', REQ_TREE_PARENT },
{ 'e', REQ_EDIT },
/* Using the ncurses SIGWINCH handler. */
{
enum open_flags flags;
+ if (request == REQ_TREE_PARENT) {
+ if (*opt_path) {
+ /* fake 'cd ..' */
+ request = REQ_ENTER;
+ line = &view->line[1];
+ } else {
+ /* quit view if at top of tree */
+ return REQ_VIEW_CLOSE;
+ }
+ }
if (request != REQ_ENTER)
return request;