From 33a1a11b54ec2dd7212e518eba2c234e373da623 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Wed, 19 Aug 2020 20:02:42 -0500 Subject: [PATCH] Replace "bindings" with "actions" (#7332) 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 2c4b868b2093367f5f195399c98d870bc61e05fa) --- src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp | 3 +-- src/cascadia/TerminalApp/GlobalAppSettings.cpp | 4 ++-- src/cascadia/TerminalApp/defaults-universal.json | 2 +- src/cascadia/TerminalApp/defaults.json | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp b/src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp index 8aed7e4525d..86313dc0e73 100644 --- a/src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp +++ b/src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp @@ -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" } }, @@ -2528,5 +2528,4 @@ namespace TerminalAppLocalTests VERIFY_IS_TRUE(realArgs.TerminalArgs().Profile().empty()); } } - } diff --git a/src/cascadia/TerminalApp/GlobalAppSettings.cpp b/src/cascadia/TerminalApp/GlobalAppSettings.cpp index 5ba27d8ecc3..fe4dc828cc0 100644 --- a/src/cascadia/TerminalApp/GlobalAppSettings.cpp +++ b/src/cascadia/TerminalApp/GlobalAppSettings.cpp @@ -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" }; @@ -233,7 +233,7 @@ void GlobalAppSettings::LayerJson(const Json::Value& json) } }; parseBindings(LegacyKeybindingsKey); - parseBindings(BindingsKey); + parseBindings(ActionsKey); } // Method Description: diff --git a/src/cascadia/TerminalApp/defaults-universal.json b/src/cascadia/TerminalApp/defaults-universal.json index 0ac56908499..993da6d8f47 100644 --- a/src/cascadia/TerminalApp/defaults-universal.json +++ b/src/cascadia/TerminalApp/defaults-universal.json @@ -72,7 +72,7 @@ "brightWhite": "#FFFFFF" } ], - "keybindings": + "actions": [ // Application-level Keys { "command": "closeWindow", "keys": "alt+f4" }, diff --git a/src/cascadia/TerminalApp/defaults.json b/src/cascadia/TerminalApp/defaults.json index a05668723f8..3db509829ce 100644 --- a/src/cascadia/TerminalApp/defaults.json +++ b/src/cascadia/TerminalApp/defaults.json @@ -271,7 +271,7 @@ "brightWhite": "#EEEEEC" } ], - "bindings": + "actions": [ // Application-level Keys { "command": "closeWindow", "keys": "alt+f4" },