From 2c4b868b2093367f5f195399c98d870bc61e05fa 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 --- .../LocalTests_TerminalApp/SettingsTests.cpp | 28 +++++++++---------- .../TerminalApp/GlobalAppSettings.cpp | 4 +-- .../TerminalApp/defaults-universal.json | 2 +- src/cascadia/TerminalApp/defaults.json | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp b/src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp index 26c764bc8..f72229526 100644 --- a/src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp +++ b/src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp @@ -2438,7 +2438,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" } }, @@ -2640,7 +2640,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "name": "iterable command ${profile.name}", "iterateOn": "profiles", @@ -2771,7 +2771,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "iterateOn": "profiles", "command": { "action": "splitPane", "profile": "${profile.name}" } @@ -2902,7 +2902,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "name": "iterable command ${profile.name}", "iterateOn": "profiles", @@ -3039,7 +3039,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "name": "Connect to ssh...", "commands": [ @@ -3142,7 +3142,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "name": "grandparent", "commands": [ @@ -3290,7 +3290,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "iterateOn": "profiles", "name": "${profile.name}...", @@ -3443,7 +3443,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "name": "New Tab With Profile...", "commands": [ @@ -3551,7 +3551,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "name": "New Pane...", "commands": [ @@ -3714,7 +3714,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "commands": [ { @@ -3777,7 +3777,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "name": "parent", "commands": [ @@ -3798,7 +3798,7 @@ namespace TerminalAppLocalTests const std::string settings1Json{ R"( { "defaultProfile": "{6239a42c-0000-49a3-80bd-e8fdd045185c}", - "bindings": [ + "actions": [ { "name": "parent", "commands": null @@ -3860,7 +3860,7 @@ namespace TerminalAppLocalTests "commandline": "wsl.exe" } ], - "bindings": [ + "actions": [ { "name": "parent", "commands": [ @@ -3881,7 +3881,7 @@ namespace TerminalAppLocalTests const std::string settings1Json{ R"( { "defaultProfile": "{6239a42c-0000-49a3-80bd-e8fdd045185c}", - "bindings": [ + "actions": [ { "name": "parent", "command": "newTab" diff --git a/src/cascadia/TerminalApp/GlobalAppSettings.cpp b/src/cascadia/TerminalApp/GlobalAppSettings.cpp index 834038bfa..449502509 100644 --- a/src/cascadia/TerminalApp/GlobalAppSettings.cpp +++ b/src/cascadia/TerminalApp/GlobalAppSettings.cpp @@ -16,7 +16,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" }; @@ -202,7 +202,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 0ac569084..993da6d8f 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 4a272e4d0..bab95d13a 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" },