-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crash and empty action in SUI Actions Page #11427
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,15 +94,14 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation | |
static void RegisterShortcutAction(ShortcutAction shortcutAction, std::unordered_map<hstring, Model::ActionAndArgs>& list, std::unordered_set<InternalActionID>& visited) | ||
{ | ||
const auto actionAndArgs{ make_self<ActionAndArgs>(shortcutAction) }; | ||
if (actionAndArgs->Action() != ShortcutAction::Invalid) | ||
/*We have a valid action.*/ | ||
/*Check if the action was already added.*/ | ||
if (visited.find(Hash(*actionAndArgs)) == visited.end()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might have blocked over the two of these nits combined -- the comments don't follow our style at all (even spacing-wise), for example..? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't add the comments though... |
||
{ | ||
/*We have a valid action.*/ | ||
/*Check if the action was already added.*/ | ||
if (visited.find(Hash(*actionAndArgs)) == visited.end()) | ||
/*This is an action that wasn't added!*/ | ||
/*Let's add it if it has a name.*/ | ||
if (const auto name{ actionAndArgs->GenerateName() }; !name.empty()) | ||
{ | ||
/*This is an action that wasn't added!*/ | ||
/*Let's add it.*/ | ||
const auto name{ actionAndArgs->GenerateName() }; | ||
list.insert({ name, *actionAndArgs }); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
&
isn't necessarily needed here.