Skip to content

Commit ace9dc7

Browse files
committed
update old hotkey trigger to use ActionKeyword
1 parent a1e371b commit ace9dc7

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,5 @@ internal static class Constants
2828

2929
internal static string ExplorerIconImageFullPath
3030
=> Directory.GetParent(Assembly.GetExecutingAssembly().Location.ToString()) + "\\" + ExplorerIconImagePath;
31-
32-
internal const string WindowsIndexFileContentSearchHotkey = "content:";
3331
}
3432
}

Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ internal List<Result> Search(Query query)
4242
if (string.IsNullOrEmpty(querySearch))
4343
return results;
4444

45-
if (IsFileContentSearch(querySearch))
45+
if (IsFileContentSearch(query.ActionKeyword))
4646
return WindowsIndexFileContentSearch(query, querySearch);
4747

4848
var isEnvironmentVariable = EnvironmentVariables.IsEnvironmentVariableSearch(querySearch);
@@ -81,24 +81,18 @@ private List<Result> WindowsIndexFileContentSearch(Query query, string querySear
8181
{
8282
var queryConstructor = new QueryConstructor(settings);
8383

84-
var updatedQuerySearchString = querySearchString
85-
.Substring(querySearchString
86-
.IndexOf(Constants.WindowsIndexFileContentSearchHotkey)
87-
+ Constants.WindowsIndexFileContentSearchHotkey.Length);
88-
89-
if (string.IsNullOrEmpty(updatedQuerySearchString))
84+
if (string.IsNullOrEmpty(querySearchString))
9085
return new List<Result>();
9186

92-
return indexSearch.WindowsIndexSearch(updatedQuerySearchString.TrimStart(),
87+
return indexSearch.WindowsIndexSearch(querySearchString,
9388
queryConstructor.CreateQueryHelper().ConnectionString,
9489
queryConstructor.QueryForFileContentSearch,
9590
query);
9691
}
9792

98-
public bool IsFileContentSearch(string querySearch)
93+
public bool IsFileContentSearch(string actionKeyword)
9994
{
100-
return querySearch.StartsWith(Constants.WindowsIndexFileContentSearchHotkey,
101-
StringComparison.OrdinalIgnoreCase);
95+
return actionKeyword == settings.FileContentSearchActionKeyword;
10296
}
10397

10498
private List<Result> DirectoryInfoClassSearch(Query query, string querySearch)

0 commit comments

Comments
 (0)