Skip to content

Commit 9fb0233

Browse files
authored
Merge branch 'dev' into dev3
2 parents 3ab1fb1 + 243ebb8 commit 9fb0233

File tree

6 files changed

+62
-11
lines changed

6 files changed

+62
-11
lines changed

.github/workflows/pr_assignee.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
name: Assign PR to creator
22

3-
# Due to GitHub token limitation, only able to assign org members not authors from forks.
4-
# https://github.com/thomaseizinger/assign-pr-creator-action/issues/3
5-
63
on:
7-
pull_request:
4+
pull_request_target:
85
types: [opened]
96
branches-ignore:
107
- l10n_dev
118

9+
permissions:
10+
pull-requests: write
11+
1212
jobs:
1313
automation:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Assign PR to creator
17-
uses: thomaseizinger/[email protected]
17+
uses: toshimaru/[email protected]
1818
with:
1919
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_milestone.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
types: [opened]
88

9+
permissions:
10+
pull-requests: write
11+
912
jobs:
1013
automation:
1114
runs-on: ubuntu-latest

Flow.Launcher.Core/Resource/AvailableLanguages.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ internal static class AvailableLanguages
2828
public static Language Czech = new Language("cs", "čeština");
2929
public static Language Arabic = new Language("ar", "اللغة العربية");
3030
public static Language Vietnamese = new Language("vi-vn", "Tiếng Việt");
31+
public static Language Hebrew = new Language("he", "עברית");
3132

3233

3334
public static List<Language> GetAvailableLanguages()
@@ -57,7 +58,8 @@ public static List<Language> GetAvailableLanguages()
5758
Turkish,
5859
Czech,
5960
Arabic,
60-
Vietnamese
61+
Vietnamese,
62+
Hebrew
6163
};
6264
return languages;
6365
}

Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ public class ColorSchemeData : DropdownDataGeneric<ColorSchemes> { }
132132
"ddd dd'/'MM",
133133
"dddd dd'/'MM",
134134
"dddd dd', 'MMMM",
135-
"dd', 'MMMM"
135+
"dd', 'MMMM",
136+
"dd.MM.yy",
137+
"dd.MM.yyyy"
136138
};
137139

138140
public string TimeFormat

Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
using System;
2+
using System.Text.RegularExpressions;
23
using Microsoft.Search.Interop;
34

45
namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
56
{
67
public class QueryConstructor
78
{
9+
private static Regex _specialCharacterMatcher = new(@"[\@\@\#\#\&\&*_;,\%\|\!\(\)\{\}\[\]\^\~\?\\""\/\:\=\-]+", RegexOptions.Compiled);
10+
private static Regex _multiWhiteSpacesMatcher = new(@"\s+", RegexOptions.Compiled);
11+
812
private Settings settings { get; }
913

1014
private const string SystemIndex = "SystemIndex";
@@ -76,8 +80,39 @@ public string FilesAndFolders(ReadOnlySpan<char> userSearchString)
7680
if (userSearchString.IsWhiteSpace())
7781
userSearchString = "*";
7882

83+
// Remove any special characters that might cause issues with the query
84+
var replacedSearchString = ReplaceSpecialCharacterWithTwoSideWhiteSpace(userSearchString);
85+
7986
// Generate SQL from constructed parameters, converting the userSearchString from AQS->WHERE clause
80-
return $"{CreateBaseQuery().GenerateSQLFromUserQuery(userSearchString.ToString())} AND {RestrictionsForAllFilesAndFoldersSearch} ORDER BY {FileName}";
87+
return $"{CreateBaseQuery().GenerateSQLFromUserQuery(replacedSearchString)} AND {RestrictionsForAllFilesAndFoldersSearch} ORDER BY {FileName}";
88+
}
89+
90+
/// <summary>
91+
/// If one special character have white space on one side, replace it with one white space.
92+
/// So command will not have "[special character]+*" which will cause OLEDB exception.
93+
/// </summary>
94+
private static string ReplaceSpecialCharacterWithTwoSideWhiteSpace(ReadOnlySpan<char> input)
95+
{
96+
const string whiteSpace = " ";
97+
98+
var inputString = input.ToString();
99+
100+
// Use regex to match special characters with whitespace on one side
101+
// and replace them with a single space
102+
var result = _specialCharacterMatcher.Replace(inputString, match =>
103+
{
104+
// Check if the match has whitespace on one side
105+
bool hasLeadingWhitespace = match.Index > 0 && char.IsWhiteSpace(inputString[match.Index - 1]);
106+
bool hasTrailingWhitespace = match.Index + match.Length < inputString.Length && char.IsWhiteSpace(inputString[match.Index + match.Length]);
107+
if (hasLeadingWhitespace || hasTrailingWhitespace)
108+
{
109+
return whiteSpace;
110+
}
111+
return match.Value;
112+
});
113+
114+
// Remove any extra spaces that might have been introduced
115+
return _multiWhiteSpacesMatcher.Replace(result, whiteSpace).Trim();
81116
}
82117

83118
///<summary>

Plugins/Flow.Launcher.Plugin.Sys/Main.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ public void Init(PluginInitContext context)
103103
private List<Result> Commands()
104104
{
105105
var results = new List<Result>();
106+
var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version);
107+
var userDataPath = DataLocation.DataDirectory();
108+
var recycleBinFolder = "shell:RecycleBinFolder";
106109
results.AddRange(new[]
107110
{
108111
new Result
@@ -264,10 +267,11 @@ private List<Result> Commands()
264267
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_openrecyclebin"),
265268
IcoPath = "Images\\openrecyclebin.png",
266269
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe74d"),
270+
CopyText = recycleBinFolder,
267271
Action = c =>
268272
{
269273
{
270-
System.Diagnostics.Process.Start("explorer", "shell:RecycleBinFolder");
274+
System.Diagnostics.Process.Start("explorer", recycleBinFolder);
271275
}
272276

273277
return true;
@@ -356,9 +360,10 @@ private List<Result> Commands()
356360
Title = "Open Log Location",
357361
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_log_location"),
358362
IcoPath = "Images\\app.png",
363+
CopyText = logPath,
364+
AutoCompleteText = logPath,
359365
Action = c =>
360366
{
361-
var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version);
362367
context.API.OpenDirectory(logPath);
363368
return true;
364369
}
@@ -368,6 +373,8 @@ private List<Result> Commands()
368373
Title = "Flow Launcher Tips",
369374
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_docs_tips"),
370375
IcoPath = "Images\\app.png",
376+
CopyText = Constant.Documentation,
377+
AutoCompleteText = Constant.Documentation,
371378
Action = c =>
372379
{
373380
context.API.OpenUrl(Constant.Documentation);
@@ -379,9 +386,11 @@ private List<Result> Commands()
379386
Title = "Flow Launcher UserData Folder",
380387
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_userdata_location"),
381388
IcoPath = "Images\\app.png",
389+
CopyText = userDataPath,
390+
AutoCompleteText = userDataPath,
382391
Action = c =>
383392
{
384-
context.API.OpenDirectory(DataLocation.DataDirectory());
393+
context.API.OpenDirectory(userDataPath);
385394
return true;
386395
}
387396
},

0 commit comments

Comments
 (0)