Skip to content

Commit

Permalink
Replace "bindings" with "actions" (#7332)
Browse files Browse the repository at this point in the history
In #6532, we thought it would be a good idea to add "bindings" as an
overload for "keybindings", as we were no longer going to use the
keybindings array for just keybindings. We were going to add commands.
So we started secretly treating `"bindings"` the same as
`"keybindings"`.

Then, in #7175, we discussed using "actions" as the key for the list of
commands/keybindings/global actions, instead of using "bindings". We're
going to be using this array as the global list of all actions, so it
makes sense to just call it `"actions"`.

This PR renames "bindings" to "actions". Fortunately, we never
documented the "bindings" overload in the first place, so we can get
away with this safely, and preferably before we ship "bindings" for too
long.

References #6899

(cherry picked from commit 2c4b868)
  • Loading branch information
zadjii-msft authored and DHowett committed Aug 20, 2020
1 parent f1878f7 commit 33a1a11
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2354,7 +2354,7 @@ namespace TerminalAppLocalTests
"commandline": "wsl.exe"
}
],
"bindings": [
"actions": [
{ "keys": "ctrl+a", "command": { "action": "splitPane", "split": "vertical" } },
{ "name": "ctrl+b", "command": { "action": "splitPane", "split": "vertical" } },
{ "keys": "ctrl+c", "name": "ctrl+c", "command": { "action": "splitPane", "split": "vertical" } },
Expand Down Expand Up @@ -2528,5 +2528,4 @@ namespace TerminalAppLocalTests
VERIFY_IS_TRUE(realArgs.TerminalArgs().Profile().empty());
}
}

}
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/GlobalAppSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using namespace ::Microsoft::Console;
using namespace winrt::Microsoft::UI::Xaml::Controls;

static constexpr std::string_view LegacyKeybindingsKey{ "keybindings" };
static constexpr std::string_view BindingsKey{ "bindings" };
static constexpr std::string_view ActionsKey{ "actions" };
static constexpr std::string_view DefaultProfileKey{ "defaultProfile" };
static constexpr std::string_view AlwaysShowTabsKey{ "alwaysShowTabs" };
static constexpr std::string_view InitialRowsKey{ "initialRows" };
Expand Down Expand Up @@ -233,7 +233,7 @@ void GlobalAppSettings::LayerJson(const Json::Value& json)
}
};
parseBindings(LegacyKeybindingsKey);
parseBindings(BindingsKey);
parseBindings(ActionsKey);
}

// Method Description:
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/defaults-universal.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"brightWhite": "#FFFFFF"
}
],
"keybindings":
"actions":
[
// Application-level Keys
{ "command": "closeWindow", "keys": "alt+f4" },
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
"brightWhite": "#EEEEEC"
}
],
"bindings":
"actions":
[
// Application-level Keys
{ "command": "closeWindow", "keys": "alt+f4" },
Expand Down

0 comments on commit 33a1a11

Please sign in to comment.