From 78dbc0c53dbc5c2471dd96e14f6feca38b9a449b Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 5 Dec 2021 19:40:36 +1100 Subject: [PATCH] simplify suggestion's autocomplete logic --- .../Converters/QuerySuggestionBoxConverter.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs b/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs index 1890cba6e..acbbf6971 100644 --- a/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs +++ b/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs @@ -43,13 +43,11 @@ namespace Flow.Launcher.Converters if (!selectedResultPossibleSuggestion.StartsWith(queryText, StringComparison.CurrentCultureIgnoreCase)) return string.Empty; - // construct autocomplete with suggestion - string _suggestion = queryText + selectedResultPossibleSuggestion.Substring(queryText.Length); - if (string.IsNullOrEmpty(selectedResult.AutoCompleteText)) - selectedItem.QuerySuggestionText = _suggestion; - + // For AutocompleteQueryCommand. // When user typed lower case and result title is uppercase, we still want to display suggestion - return queryText + selectedResultPossibleSuggestion.Substring(queryText.Length); + selectedItem.QuerySuggestionText = queryText + selectedResultPossibleSuggestion.Substring(queryText.Length); + + return selectedItem.QuerySuggestionText; } catch (Exception e) {