Skip to content

Commit 0dff336

Browse files
nits, schema
1 parent 51528e9 commit 0dff336

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

doc/cascadia/profiles.schema.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@
629629
"folder",
630630
"separator",
631631
"remainingProfiles",
632-
"matchProfiles"
632+
"matchProfiles",
633+
"action"
633634
]
634635
},
635636
"NewTabMenuEntry": {
@@ -781,6 +782,28 @@
781782
}
782783
]
783784
},
785+
"ActionEntry": {
786+
"description": "An action in the new tab dropdown",
787+
"allOf": [
788+
{
789+
"$ref": "#/$defs/NewTabMenuEntry"
790+
},
791+
{
792+
"type": "object",
793+
"properties": {
794+
"type": {
795+
"type": "string",
796+
"const": "action"
797+
},
798+
"profile": {
799+
"type": "string",
800+
"default": "",
801+
"description": "The ID of the action to show in this entry"
802+
}
803+
}
804+
}
805+
]
806+
},
784807
"SwitchToAdjacentTabArgs": {
785808
"oneOf": [
786809
{
@@ -2054,6 +2077,9 @@
20542077
},
20552078
{
20562079
"$ref": "#/$defs/RemainingProfilesEntry"
2080+
},
2081+
{
2082+
"$ref": "#/$defs/ActionEntry"
20572083
}
20582084
]
20592085
}

src/cascadia/TerminalApp/TerminalPage.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,13 +1008,12 @@ namespace winrt::TerminalApp::implementation
10081008
{
10091009
const auto actionEntry = entry.as<ActionEntry>();
10101010
const auto actionId = actionEntry.ActionId();
1011-
if (_settings.ActionMap().GetActionById(actionId) == nullptr)
1011+
if (_settings.ActionMap().GetActionById(actionId))
10121012
{
1013-
break;
1013+
auto actionItem = _CreateNewTabFlyoutAction(actionId);
1014+
items.push_back(actionItem);
10141015
}
10151016

1016-
auto actionItem = _CreateNewTabFlyoutAction(actionId);
1017-
items.push_back(actionItem);
10181017
break;
10191018
}
10201019
}
@@ -1121,7 +1120,7 @@ namespace winrt::TerminalApp::implementation
11211120
_SetAcceleratorForMenuItem(actionMenuItem, actionKeyChord);
11221121
}
11231122

1124-
auto actionName = action.Name();
1123+
const auto actionName = action.Name();
11251124
actionMenuItem.Text(actionName);
11261125

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

0 commit comments

Comments
 (0)