Skip to content

Commit 192d64b

Browse files
committed
Use Constant Name
1 parent e8a9377 commit 192d64b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
2828
TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData,
2929
Action = c =>
3030
{
31-
if (c.SpecialKeyState.CtrlPressed || !(Settings.EnabledPathSearchKeyword || Settings.EnableSearchActionKeyword))
31+
if (c.SpecialKeyState.CtrlPressed || !(Settings.EnabledPathSearchKeyword || Settings.EnabledSearchActionKeyword))
3232
{
3333
try
3434
{
@@ -42,9 +42,9 @@ internal static Result CreateFolderResult(string title, string subtitle, string
4242
}
4343
}
4444
// one of it is enabled
45-
var keyword = Settings.EnableSearchActionKeyword ? Settings.SearchActionKeyword : Settings.PathSearchActionKeyword;
45+
var keyword = Settings.EnabledSearchActionKeyword ? Settings.SearchActionKeyword : Settings.PathSearchActionKeyword;
4646

47-
keyword = keyword == "*" ? "" : $"{keyword} ";
47+
keyword = keyword == Query.GlobalPluginWildcardSign ? string.Empty : keyword + "";
4848

4949
string changeTo = path.EndsWith(Constants.DirectorySeperator) ? path : path + Constants.DirectorySeperator;
5050
Context.API.ChangeQuery($"{keyword}{changeTo}");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private bool ActionKeywordMatch(Query query, Settings.ActionKeyword allowedActio
7171

7272
return allowedActionKeyword switch
7373
{
74-
Settings.ActionKeyword.SearchActionKeyword => settings.EnableSearchActionKeyword &&
74+
Settings.ActionKeyword.SearchActionKeyword => settings.EnabledSearchActionKeyword &&
7575
keyword == settings.SearchActionKeyword,
7676
Settings.ActionKeyword.PathSearchActionKeyword => settings.EnabledPathSearchKeyword &&
7777
keyword == settings.PathSearchActionKeyword,

Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class Settings
2121
public List<AccessLink> IndexSearchExcludedSubdirectoryPaths { get; set; } = new List<AccessLink>();
2222

2323
public string SearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
24-
public bool EnableSearchActionKeyword { get; set; } = true;
24+
public bool EnabledSearchActionKeyword { get; set; } = true;
2525

2626
public string FileContentSearchActionKeyword { get; set; } = Constants.DefaultContentSearchActionKeyword;
2727

@@ -60,15 +60,15 @@ internal enum ActionKeyword
6060

6161
internal bool? GetActionKeywordEnable(ActionKeyword actionKeyword) => actionKeyword switch
6262
{
63-
ActionKeyword.SearchActionKeyword => EnableSearchActionKeyword,
63+
ActionKeyword.SearchActionKeyword => EnabledSearchActionKeyword,
6464
ActionKeyword.PathSearchActionKeyword => EnabledPathSearchKeyword,
6565
ActionKeyword.IndexSearchActionKeyword => EnabledIndexOnlySearchKeyword,
6666
_ => null
6767
};
6868

6969
internal void SetActionKeywordEnable(ActionKeyword actionKeyword, bool enable) => _ = actionKeyword switch
7070
{
71-
ActionKeyword.SearchActionKeyword => EnableSearchActionKeyword = enable,
71+
ActionKeyword.SearchActionKeyword => EnabledSearchActionKeyword = enable,
7272
ActionKeyword.PathSearchActionKeyword => EnabledPathSearchKeyword = enable,
7373
ActionKeyword.IndexSearchActionKeyword => EnabledIndexOnlySearchKeyword = enable,
7474
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property")

0 commit comments

Comments
 (0)