Teach command palette to fill in selected commandline upon right arrow (#11069)
Closes #11049
This commit is contained in:
parent
e4c5e8bd2a
commit
871b8de74f
|
@ -244,6 +244,17 @@ namespace winrt::TerminalApp::implementation
|
||||||
_PreviewActionHandlers(*this, actionPaletteItem.Command());
|
_PreviewActionHandlers(*this, actionPaletteItem.Command());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (_currentMode == CommandPaletteMode::CommandlineMode)
|
||||||
|
{
|
||||||
|
if (filteredCommand)
|
||||||
|
{
|
||||||
|
SearchBoxPlaceholderText(filteredCommand.Item().Name());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SearchBoxPlaceholderText(RS_(L"CmdPalCommandlinePrompt"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandPalette::_previewKeyDownHandler(IInspectable const& /*sender*/,
|
void CommandPalette::_previewKeyDownHandler(IInspectable const& /*sender*/,
|
||||||
|
@ -364,6 +375,17 @@ namespace winrt::TerminalApp::implementation
|
||||||
_searchBox().PasteFromClipboard();
|
_searchBox().PasteFromClipboard();
|
||||||
e.Handled(true);
|
e.Handled(true);
|
||||||
}
|
}
|
||||||
|
else if (key == VirtualKey::Right && _currentMode == CommandPaletteMode::CommandlineMode)
|
||||||
|
{
|
||||||
|
if (const auto command{ _filteredActionsView().SelectedItem().try_as<winrt::TerminalApp::FilteredCommand>() })
|
||||||
|
{
|
||||||
|
_searchBox().Text(command.Item().Name());
|
||||||
|
_searchBox().Select(_searchBox().Text().size(), 0);
|
||||||
|
_searchBox().Focus(FocusState::Programmatic);
|
||||||
|
_filteredActionsView().SelectedIndex(-1);
|
||||||
|
e.Handled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
|
|
Loading…
Reference in a new issue