Skip to content

Commit

Permalink
nits, schema
Browse files Browse the repository at this point in the history
  • Loading branch information
PankajBhojwani committed May 31, 2024
1 parent 51528e9 commit 0dff336
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
28 changes: 27 additions & 1 deletion doc/cascadia/profiles.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,8 @@
"folder",
"separator",
"remainingProfiles",
"matchProfiles"
"matchProfiles",
"action"
]
},
"NewTabMenuEntry": {
Expand Down Expand Up @@ -781,6 +782,28 @@
}
]
},
"ActionEntry": {
"description": "An action in the new tab dropdown",
"allOf": [
{
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "action"
},
"profile": {
"type": "string",
"default": "",
"description": "The ID of the action to show in this entry"
}
}
}
]
},
"SwitchToAdjacentTabArgs": {
"oneOf": [
{
Expand Down Expand Up @@ -2054,6 +2077,9 @@
},
{
"$ref": "#/$defs/RemainingProfilesEntry"
},
{
"$ref": "#/$defs/ActionEntry"
}
]
}
Expand Down
9 changes: 4 additions & 5 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1008,13 +1008,12 @@ namespace winrt::TerminalApp::implementation
{
const auto actionEntry = entry.as<ActionEntry>();
const auto actionId = actionEntry.ActionId();
if (_settings.ActionMap().GetActionById(actionId) == nullptr)
if (_settings.ActionMap().GetActionById(actionId))
{
break;
auto actionItem = _CreateNewTabFlyoutAction(actionId);
items.push_back(actionItem);
}

auto actionItem = _CreateNewTabFlyoutAction(actionId);
items.push_back(actionItem);
break;
}
}
Expand Down Expand Up @@ -1121,7 +1120,7 @@ namespace winrt::TerminalApp::implementation
_SetAcceleratorForMenuItem(actionMenuItem, actionKeyChord);
}

auto actionName = action.Name();
const auto actionName = action.Name();
actionMenuItem.Text(actionName);

// If there's an icon set for this action, set it as the icon for
Expand Down

0 comments on commit 0dff336

Please sign in to comment.