From 4ee3cffeabfc640a30a625b6de9b05c3b21a2cba Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 24 Jan 2009 12:36:03 +0100 Subject: [PATCH] Rename tree-parent action to parent --- NEWS | 2 ++ manual.txt | 3 ++- tig.c | 27 ++++++++++++++++++--------- tigrc.5.txt | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 04a1c83..6109737 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ Incompatibilities: - The screen-resize action has been deprecated. It had no real use for users and was never meant to be exposed. + - The "tree-parent" action was renamed to "parent". Warnings will be + emitted for transition. Improvements: diff --git a/manual.txt b/manual.txt index 34bc753..87f9492 100644 --- a/manual.txt +++ b/manual.txt @@ -344,6 +344,8 @@ Up This key is "context sensitive" and will move the cursor one \ the previous commit in the main view and update the diff view \ to display it. Down Similar to 'Up' but will move down. +',' Move to parent. In the tree view, this means switch to the parent \ + directory. ----------------------------------------------------------------------------- [[cursor-nav]] @@ -419,7 +421,6 @@ M Resolve unmerged file by launching git-mergetool(1). Note, to work \ ! Checkout file with unstaged changes. This will reset the file to \ contain the content it had at last commit. @ Move to next chunk in the stage view. -',' Move tree view to the parent tree. e Open file in editor. ----------------------------------------------------------------------------- diff --git a/tig.c b/tig.c index 8c65a47..f729321 100644 --- a/tig.c +++ b/tig.c @@ -666,6 +666,7 @@ static int read_properties(struct io *io, const char *separators, int (*read)(ch REQ_(ENTER, "Enter current line and scroll"), \ REQ_(NEXT, "Move to next"), \ REQ_(PREVIOUS, "Move to previous"), \ + REQ_(PARENT, "Move to parent"), \ REQ_(VIEW_NEXT, "Move focus to next view"), \ REQ_(REFRESH, "Reload and refresh"), \ REQ_(MAXIMIZE, "Maximize the current view"), \ @@ -677,7 +678,6 @@ static int read_properties(struct io *io, const char *separators, int (*read)(ch REQ_(STATUS_REVERT, "Revert file changes"), \ REQ_(STATUS_MERGE, "Merge file using external tool"), \ REQ_(STAGE_NEXT, "Find next chunk to stage"), \ - REQ_(TREE_PARENT, "Switch to parent directory in tree view"), \ \ REQ_GROUP("Cursor navigation") \ REQ_(MOVE_UP, "Move cursor one line up"), \ @@ -1116,7 +1116,7 @@ static struct keybinding default_keybindings[] = { { '!', REQ_STATUS_REVERT }, { 'M', REQ_STATUS_MERGE }, { '@', REQ_STAGE_NEXT }, - { ',', REQ_TREE_PARENT }, + { ',', REQ_PARENT }, { 'e', REQ_EDIT }, }; @@ -1551,16 +1551,25 @@ option_bind_command(int argc, const char *argv[]) request = get_request(argv[2]); if (request == REQ_NONE) { - const char *obsolete[] = { "cherry-pick", "screen-resize" }; + struct { + const char *name; + enum request request; + } obsolete[] = { + { "cherry-pick", REQ_NONE }, + { "screen-resize", REQ_NONE }, + { "tree-parent", REQ_PARENT }, + }; size_t namelen = strlen(argv[2]); int i; for (i = 0; i < ARRAY_SIZE(obsolete); i++) { - if (namelen == strlen(obsolete[i]) && - !string_enum_compare(obsolete[i], argv[2], namelen)) { - config_msg = "Obsolete request name"; - return ERR; - } + if (namelen != strlen(obsolete[i].name) || + string_enum_compare(obsolete[i].name, argv[2], namelen)) + continue; + if (obsolete[i].request != REQ_NONE) + add_keybinding(keymap, obsolete[i].request, key); + config_msg = "Obsolete request name"; + return ERR; } } if (request == REQ_NONE && *argv[2]++ == '!') @@ -3939,7 +3948,7 @@ tree_request(struct view *view, enum request request, struct line *line) } return REQ_NONE; - case REQ_TREE_PARENT: + case REQ_PARENT: if (!*opt_path) { /* quit view if at top of tree */ return REQ_VIEW_CLOSE; diff --git a/tigrc.5.txt b/tigrc.5.txt index 02af7fa..3da0d2f 100644 --- a/tigrc.5.txt +++ b/tigrc.5.txt @@ -220,6 +220,7 @@ View manipulation: enter Enter current line and scroll next Move to next previous Move to previous +parent Move to parent view-next Move focus to next view refresh Reload and refresh view maximize Maximize the current view @@ -285,7 +286,6 @@ toggle-refs Toggle reference display status-update Update file status status-merge Resolve unmerged file stage-next Find next chunk to stage -tree-parent Switch to parent directory in tree view edit Open in editor ------------------------------------------------------------------------------ -- 2.32.0.93.g670b81a890