Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Flow.Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,7 @@ private void OnKeyDown(object sender, KeyEventArgs e)
break;
case Key.Right:
if (_viewModel.QueryResultsSelected()
&& QueryTextBox.CaretIndex == QueryTextBox.Text.Length
&& !string.IsNullOrEmpty(QueryTextBox.Text))
&& QueryTextBox.CaretIndex == QueryTextBox.Text.Length)
{
_viewModel.LoadContextMenuCommand.Execute(null);
e.Handled = true;
Expand Down
28 changes: 16 additions & 12 deletions Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ private ResultsViewModel SelectedResults
// so we need manually call Query()
// http://stackoverflow.com/posts/25895769/revisions
QueryText = string.Empty;

// When we are changing query because selected results are changed to history or context menu,
// we should not delay the query
Query(false);
Expand Down Expand Up @@ -1220,22 +1221,25 @@ public void QueryResults()

public void Query(bool searchDelay, bool isReQuery = false)
{
if (_ignoredQueryText != null)
if (QueryResultsSelected())
{
if (_ignoredQueryText == QueryText)
{
_ignoredQueryText = null;
return;
}
else
// We use this to skip creating a new result set and keep the old results.
// This matching is used for programmatic QueryText changes (not user typing),
// such as when returning to the results from the context menu
if (_ignoredQueryText != null)
{
// If _ignoredQueryText does not match current QueryText, we should still execute Query
_ignoredQueryText = null;
if (_ignoredQueryText == QueryText)
{
_ignoredQueryText = null;
return;
}
else
{
// If _ignoredQueryText does not match current QueryText, we should still execute Query
_ignoredQueryText = null;
}
}
}

if (QueryResultsSelected())
{
_ = QueryResultsAsync(searchDelay, isReQuery);
}
else if (ContextMenuSelected())
Expand Down
Loading