Skip to content

Commit

Permalink
Dismiss the snippet preview when there is no suggestions
Browse files Browse the repository at this point in the history
Pretty obvious in retrospect. If there's no results, then we need to preview
_nothing_ to make sure that we clear out any old previews.

Closes #17773
  • Loading branch information
zadjii-msft committed Aug 22, 2024
1 parent cbb4a0a commit 6aff623
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cascadia/TerminalApp/SuggestionsControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,10 @@ namespace winrt::TerminalApp::implementation
_filteredActionsView().SelectedIndex(std::min<int32_t>(lastSelectedIndex, _filteredActionsView().Items().Size() - 1));

const auto currentNeedleHasResults{ _filteredActions.Size() > 0 };
if (!currentNeedleHasResults)
{
PreviewAction.raise(*this, nullptr);
}
_noMatchesText().Visibility(currentNeedleHasResults ? Visibility::Collapsed : Visibility::Visible);
if (auto automationPeer{ Automation::Peers::FrameworkElementAutomationPeer::FromElement(_searchBox()) })
{
Expand Down

0 comments on commit 6aff623

Please sign in to comment.