Skip to content

Commit ce8b31b

Browse files
use x-macro here instead
1 parent d973836 commit ce8b31b

File tree

1 file changed

+8
-82
lines changed

1 file changed

+8
-82
lines changed

src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp

Lines changed: 8 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,88 +1035,14 @@ Model::IActionArgs CascadiaSettings::GetEmptyArgsForAction(Model::ShortcutAction
10351035
{
10361036
switch (shortcutAction)
10371037
{
1038-
case Model::ShortcutAction::CopyText:
1039-
return winrt::make<CopyTextArgs>();
1040-
case Model::ShortcutAction::MovePane:
1041-
return winrt::make<MovePaneArgs>();
1042-
case Model::ShortcutAction::SwitchToTab:
1043-
return winrt::make<SwitchToTabArgs>();
1044-
case Model::ShortcutAction::ResizePane:
1045-
return winrt::make<ResizePaneArgs>();
1046-
case Model::ShortcutAction::MoveFocus:
1047-
return winrt::make<MoveFocusArgs>();
1048-
case Model::ShortcutAction::SwapPane:
1049-
return winrt::make<SwapPaneArgs>();
1050-
case Model::ShortcutAction::AdjustFontSize:
1051-
return winrt::make<AdjustFontSizeArgs>();
1052-
case Model::ShortcutAction::SendInput:
1053-
return winrt::make<SendInputArgs>();
1054-
case Model::ShortcutAction::OpenSettings:
1055-
return winrt::make<OpenSettingsArgs>();
1056-
case Model::ShortcutAction::SetFocusMode:
1057-
return winrt::make<SetFocusModeArgs>();
1058-
case Model::ShortcutAction::SetFullScreen:
1059-
return winrt::make<SetFullScreenArgs>();
1060-
case Model::ShortcutAction::SetMaximized:
1061-
return winrt::make<SetMaximizedArgs>();
1062-
case Model::ShortcutAction::SetColorScheme:
1063-
return winrt::make<SetColorSchemeArgs>();
1064-
case Model::ShortcutAction::RenameTab:
1065-
return winrt::make<RenameTabArgs>();
1066-
case Model::ShortcutAction::ExecuteCommandline:
1067-
return winrt::make<ExecuteCommandlineArgs>();
1068-
case Model::ShortcutAction::CloseOtherTabs:
1069-
return winrt::make<CloseOtherTabsArgs>();
1070-
case Model::ShortcutAction::CloseTabsAfter:
1071-
return winrt::make<CloseTabsAfterArgs>();
1072-
case Model::ShortcutAction::CloseTab:
1073-
return winrt::make<CloseTabArgs>();
1074-
case Model::ShortcutAction::MoveTab:
1075-
return winrt::make<MoveTabArgs>();
1076-
case Model::ShortcutAction::ScrollUp:
1077-
return winrt::make<ScrollUpArgs>();
1078-
case Model::ShortcutAction::ScrollDown:
1079-
return winrt::make<ScrollDownArgs>();
1080-
case Model::ShortcutAction::ScrollToMark:
1081-
return winrt::make<ScrollToMarkArgs>();
1082-
case Model::ShortcutAction::ToggleCommandPalette:
1083-
return winrt::make<ToggleCommandPaletteArgs>();
1084-
case Model::ShortcutAction::Suggestions:
1085-
return winrt::make<SuggestionsArgs>();
1086-
case Model::ShortcutAction::FindMatch:
1087-
return winrt::make<FindMatchArgs>();
1088-
case Model::ShortcutAction::RenameWindow:
1089-
return winrt::make<RenameWindowArgs>();
1090-
case Model::ShortcutAction::SearchForText:
1091-
return winrt::make<SearchForTextArgs>();
1092-
case Model::ShortcutAction::GlobalSummon:
1093-
return winrt::make<GlobalSummonArgs>();
1094-
case Model::ShortcutAction::FocusPane:
1095-
return winrt::make<FocusPaneArgs>();
1096-
case Model::ShortcutAction::ExportBuffer:
1097-
return winrt::make<ExportBufferArgs>();
1098-
case Model::ShortcutAction::ClearBuffer:
1099-
return winrt::make<ClearBufferArgs>();
1100-
case Model::ShortcutAction::AdjustOpacity:
1101-
return winrt::make<AdjustOpacityArgs>();
1102-
case Model::ShortcutAction::SelectCommand:
1103-
return winrt::make<SelectCommandArgs>();
1104-
case Model::ShortcutAction::SelectOutput:
1105-
return winrt::make<SelectOutputArgs>();
1106-
case Model::ShortcutAction::AddMark:
1107-
return winrt::make<AddMarkArgs>();
1108-
case Model::ShortcutAction::SetTabColor:
1109-
return winrt::make<SetTabColorArgs>();
1110-
case Model::ShortcutAction::PrevTab:
1111-
return winrt::make<PrevTabArgs>();
1112-
case Model::ShortcutAction::NextTab:
1113-
return winrt::make<NextTabArgs>();
1114-
case Model::ShortcutAction::NewTab:
1115-
return winrt::make<NewTabArgs>();
1116-
case Model::ShortcutAction::NewWindow:
1117-
return winrt::make<NewWindowArgs>();
1118-
case Model::ShortcutAction::SplitPane:
1119-
return winrt::make<SplitPaneArgs>();
1038+
#define ON_ALL_ACTIONS_WITH_ARGS(name) \
1039+
case Model::ShortcutAction::name: \
1040+
return winrt::make<name##Args>();
1041+
1042+
ALL_SHORTCUT_ACTIONS_WITH_ARGS
1043+
1044+
#undef ON_ALL_ACTIONS_WITH_ARGS
1045+
11201046
default:
11211047
return nullptr;
11221048
}

0 commit comments

Comments
 (0)