b3b648496e
## Summary of the Pull Request #10297 found a bug in `ActionMap` where the `ToggleCommandPalette` key chord could not be found using `GetKeyBindingForAction`. This was caused by the following: - `AddAction`: when adding the action, the `ActionAndArgs` is basically added as `{ToggleCommandPalette, ToggleCommandLineArgs{}}` (Note the default ctor used for the action args) - `GetKeyBindingForAction`: we're searching for an `ActionAndArgs` structured as `{ToggleCommandPalette, nullptr}` - Since these are _technically_ two different actions, we are unable to find it. This issue was fixed by making the `Hash(ActionAndArgs)` function smarter! If the `ActionAndArgs` has no args, but the `ShortcutAction` _supports_ args, generate the args using the default ctor. By making `Hash()` smarter, everybody benefits from this logic! We can basically now enforce that `ActionAndArgs{ <X>, nullptr } == ActionAndArgs{ <X>, <default_ctor> }`. ## Validation Steps Performed - Added a test. - Tested this on #10297's branch and this does fix the bug |
||
---|---|---|
.. | ||
ColorSchemeTests.cpp | ||
CommandTests.cpp | ||
DeserializationTests.cpp | ||
JsonTestClass.h | ||
KeyBindingsTests.cpp | ||
LocalTests_SettingsModel.def | ||
pch.cpp | ||
pch.h | ||
ProfileTests.cpp | ||
SerializationTests.cpp | ||
SettingsModel.LocalTests.vcxproj | ||
TerminalSettingsTests.cpp | ||
TestUtils.h |