Skip to content

Commit c99790b

Browse files
authored
Merge pull request #1848 from TheBestPessimist/#1800_Everything_search_full_path
Everything Search: Match Path
2 parents 0bdea7c + 18d1bb5 commit c99790b

File tree

2 files changed

+11
-48
lines changed

2 files changed

+11
-48
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313

1414
namespace Flow.Launcher.Plugin.Explorer.Search.Everything
1515
{
16-
1716
public static class EverythingApi
1817
{
19-
2018
private const int BufferSize = 4096;
2119

2220
private static SemaphoreSlim _semaphore = new(1, 1);
21+
2322
// cached buffer to remove redundant allocations.
2423
private static readonly StringBuilder buffer = new(BufferSize);
2524

@@ -35,46 +34,6 @@ public enum StateCode
3534
InvalidCallError
3635
}
3736

38-
/// <summary>
39-
/// Gets or sets a value indicating whether [match path].
40-
/// </summary>
41-
/// <value><c>true</c> if [match path]; otherwise, <c>false</c>.</value>
42-
public static bool MatchPath
43-
{
44-
get => EverythingApiDllImport.Everything_GetMatchPath();
45-
set => EverythingApiDllImport.Everything_SetMatchPath(value);
46-
}
47-
48-
/// <summary>
49-
/// Gets or sets a value indicating whether [match case].
50-
/// </summary>
51-
/// <value><c>true</c> if [match case]; otherwise, <c>false</c>.</value>
52-
public static bool MatchCase
53-
{
54-
get => EverythingApiDllImport.Everything_GetMatchCase();
55-
set => EverythingApiDllImport.Everything_SetMatchCase(value);
56-
}
57-
58-
/// <summary>
59-
/// Gets or sets a value indicating whether [match whole word].
60-
/// </summary>
61-
/// <value><c>true</c> if [match whole word]; otherwise, <c>false</c>.</value>
62-
public static bool MatchWholeWord
63-
{
64-
get => EverythingApiDllImport.Everything_GetMatchWholeWord();
65-
set => EverythingApiDllImport.Everything_SetMatchWholeWord(value);
66-
}
67-
68-
/// <summary>
69-
/// Gets or sets a value indicating whether [enable regex].
70-
/// </summary>
71-
/// <value><c>true</c> if [enable regex]; otherwise, <c>false</c>.</value>
72-
public static bool EnableRegex
73-
{
74-
get => EverythingApiDllImport.Everything_GetRegex();
75-
set => EverythingApiDllImport.Everything_SetRegex(value);
76-
}
77-
7837
/// <summary>
7938
/// Checks whether the sort option is Fast Sort.
8039
/// </summary>
@@ -95,7 +54,7 @@ public static async ValueTask<bool> IsEverythingRunningAsync(CancellationToken t
9554

9655
try
9756
{
98-
EverythingApiDllImport.Everything_GetMajorVersion();
57+
EverythingApiDllImport.Everything_GetMajorVersion();
9958
var result = EverythingApiDllImport.Everything_GetLastError() != StateCode.IPCError;
10059
return result;
10160
}
@@ -122,7 +81,7 @@ public static async IAsyncEnumerable<SearchResult> SearchAsync(EverythingSearchO
12281

12382
await _semaphore.WaitAsync(token);
12483

125-
84+
12685
try
12786
{
12887
if (token.IsCancellationRequested)
@@ -152,6 +111,7 @@ public static async IAsyncEnumerable<SearchResult> SearchAsync(EverythingSearchO
152111
EverythingApiDllImport.Everything_SetMax(option.MaxCount);
153112

154113
EverythingApiDllImport.Everything_SetSort(option.SortOption);
114+
EverythingApiDllImport.Everything_SetMatchPath(option.IsFullPathSearch);
155115

156116
if (token.IsCancellationRequested) yield break;
157117

Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchOption.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33

44
namespace Flow.Launcher.Plugin.Explorer.Search.Everything
55
{
6-
public record struct EverythingSearchOption(string Keyword,
6+
public record struct EverythingSearchOption(
7+
string Keyword,
78
SortOption SortOption,
8-
bool IsContentSearch = false,
9+
bool IsContentSearch = false,
910
string ContentSearchKeyword = default,
1011
string ParentPath = default,
1112
bool IsRecursive = true,
12-
int Offset = 0,
13-
int MaxCount = 100);
13+
int Offset = 0,
14+
int MaxCount = 100,
15+
bool IsFullPathSearch = true
16+
);
1417
}

0 commit comments

Comments
 (0)