Skip to content

Commit

Permalink
fix global summon
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-zamora committed May 5, 2021
1 parent 0741c94 commit 9cb377e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
{ ShortcutAction::NewWindow, NewWindowArgs::ToJson },
{ ShortcutAction::PrevTab, PrevTabArgs::ToJson },
{ ShortcutAction::NextTab, NextTabArgs::ToJson },
{ ShortcutAction::RenameWindow, RenameWindowArgs::ToJson }
{ ShortcutAction::RenameWindow, RenameWindowArgs::ToJson },
{ ShortcutAction::GlobalSummon, GlobalSummonArgs::ToJson }
};

// Function Description:
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalSettingsModel/ActionArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,10 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation

// "Summon the Terminal window"
// "Summon the Terminal window, name:\"{_Name}\""
if (!_Name.empty())
if (!Name().empty())
{
ss << L", name: ";
ss << std::wstring_view(_Name);
ss << std::wstring_view(Name());
}
return winrt::hstring{ ss.str() };
}
Expand Down
9 changes: 9 additions & 0 deletions src/cascadia/TerminalSettingsModel/ActionArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,15 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
JsonUtils::GetValueForKey(json, ToggleVisibilityKey, args->_ToggleVisibility);
return { *args, {} };
}
static Json::Value ToJson(const IActionArgs& val)
{
Json::Value json{ Json::ValueType::objectValue };
const auto args{ get_self<GlobalSummonArgs>(val) };
JsonUtils::SetValueForKey(json, NameKey, args->_Name);
JsonUtils::SetValueForKey(json, DesktopKey, args->_Desktop);
JsonUtils::SetValueForKey(json, ToggleVisibilityKey, args->_ToggleVisibility);
return json;
}
IActionArgs Copy() const
{
auto copy{ winrt::make_self<GlobalSummonArgs>() };
Expand Down

0 comments on commit 9cb377e

Please sign in to comment.