Skip to content

Commit 02b92c0

Browse files
committed
change variable name to AutoCompleteText
1 parent 1d9bc99 commit 02b92c0

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

Flow.Launcher.Plugin/Result.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ public class Result
2929
/// </summary>
3030
public string ActionKeywordAssigned { get; set; }
3131

32-
public string SuggestionText { get; set; } = string.Empty;
32+
/// <summary>
33+
/// This holds the text which can be provided by plugin to help Flow autocomplete text
34+
/// for user on the plugin result. If autocomplete action for example is tab, pressing tab will have
35+
/// the default constructed autocomplete text (result's Title), or the text provided here if not empty.
36+
/// </summary>
37+
public string AutoCompleteText { get; set; }
3338

3439
public string IcoPath
3540
{

Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
4343
if (!selectedResultPossibleSuggestion.StartsWith(queryText, StringComparison.CurrentCultureIgnoreCase))
4444
return string.Empty;
4545

46-
// When user typed lower case and result title is uppercase, we still want to display suggestion
47-
46+
// construct autocomplete with suggestion
4847
string _suggestion = queryText + selectedResultPossibleSuggestion.Substring(queryText.Length);
49-
if (String.IsNullOrEmpty(selectedResult.SuggestionText))
50-
{
51-
selectedItem.Result.SuggestionText = _suggestion;
52-
}
48+
if (string.IsNullOrEmpty(selectedResult.AutoCompleteText))
49+
selectedItem.Result.AutoCompleteText = _suggestion;
50+
51+
// When user typed lower case and result title is uppercase, we still want to display suggestion
5352
return queryText + selectedResultPossibleSuggestion.Substring(queryText.Length);
5453
}
5554
catch (Exception e)

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ private void InitializeKeyCommands()
235235
var result = results.SelectedItem?.Result;
236236
if (result != null) // SelectedItem returns null if selection is empty.
237237
{
238-
string _newText = String.IsNullOrEmpty(result.SuggestionText) ? result.Title : result.SuggestionText;
238+
string _newText = String.IsNullOrEmpty(result.AutoCompleteText) ? result.Title : result.AutoCompleteText;
239239

240240
var SpecialKeyState = GlobalHotkey.Instance.CheckModifiers();
241241
if (SpecialKeyState.ShiftPressed)

0 commit comments

Comments
 (0)