diff --git a/.github/workflows/pr_assignee.yml b/.github/workflows/pr_assignee.yml index af6daff02..44b808885 100644 --- a/.github/workflows/pr_assignee.yml +++ b/.github/workflows/pr_assignee.yml @@ -1,19 +1,19 @@ name: Assign PR to creator -# Due to GitHub token limitation, only able to assign org members not authors from forks. -# https://github.com/thomaseizinger/assign-pr-creator-action/issues/3 - on: - pull_request: + pull_request_target: types: [opened] branches-ignore: - l10n_dev +permissions: + pull-requests: write + jobs: automation: runs-on: ubuntu-latest steps: - name: Assign PR to creator - uses: thomaseizinger/assign-pr-creator-action@v1.0.0 + uses: toshimaru/auto-author-assign@v2.1.1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_milestone.yml b/.github/workflows/pr_milestone.yml index b343a39cc..b17912be0 100644 --- a/.github/workflows/pr_milestone.yml +++ b/.github/workflows/pr_milestone.yml @@ -6,6 +6,9 @@ on: pull_request: types: [opened] +permissions: + pull-requests: write + jobs: automation: runs-on: ubuntu-latest diff --git a/Flow.Launcher.Core/Resource/AvailableLanguages.cs b/Flow.Launcher.Core/Resource/AvailableLanguages.cs index 46c1ecb54..c385cd8e8 100644 --- a/Flow.Launcher.Core/Resource/AvailableLanguages.cs +++ b/Flow.Launcher.Core/Resource/AvailableLanguages.cs @@ -28,6 +28,7 @@ namespace Flow.Launcher.Core.Resource public static Language Czech = new Language("cs", "čeština"); public static Language Arabic = new Language("ar", "اللغة العربية"); public static Language Vietnamese = new Language("vi-vn", "Tiếng Việt"); + public static Language Hebrew = new Language("he", "עברית"); public static List GetAvailableLanguages() @@ -57,7 +58,8 @@ namespace Flow.Launcher.Core.Resource Turkish, Czech, Arabic, - Vietnamese + Vietnamese, + Hebrew }; return languages; } diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index 8a835ba7c..8d8ccb780 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -132,7 +132,9 @@ public partial class SettingsPaneThemeViewModel : BaseModel "ddd dd'/'MM", "dddd dd'/'MM", "dddd dd', 'MMMM", - "dd', 'MMMM" + "dd', 'MMMM", + "dd.MM.yy", + "dd.MM.yyyy" }; public string TimeFormat diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs index a35bad274..9e3707fbe 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs @@ -1,10 +1,14 @@ using System; +using System.Text.RegularExpressions; using Microsoft.Search.Interop; namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex { public class QueryConstructor { + private static Regex _specialCharacterMatcher = new(@"[\@\@\#\#\&\&*_;,\%\|\!\(\)\{\}\[\]\^\~\?\\""\/\:\=\-]+", RegexOptions.Compiled); + private static Regex _multiWhiteSpacesMatcher = new(@"\s+", RegexOptions.Compiled); + private Settings settings { get; } private const string SystemIndex = "SystemIndex"; @@ -76,8 +80,39 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex if (userSearchString.IsWhiteSpace()) userSearchString = "*"; + // Remove any special characters that might cause issues with the query + var replacedSearchString = ReplaceSpecialCharacterWithTwoSideWhiteSpace(userSearchString); + // Generate SQL from constructed parameters, converting the userSearchString from AQS->WHERE clause - return $"{CreateBaseQuery().GenerateSQLFromUserQuery(userSearchString.ToString())} AND {RestrictionsForAllFilesAndFoldersSearch} ORDER BY {FileName}"; + return $"{CreateBaseQuery().GenerateSQLFromUserQuery(replacedSearchString)} AND {RestrictionsForAllFilesAndFoldersSearch} ORDER BY {FileName}"; + } + + /// + /// If one special character have white space on one side, replace it with one white space. + /// So command will not have "[special character]+*" which will cause OLEDB exception. + /// + private static string ReplaceSpecialCharacterWithTwoSideWhiteSpace(ReadOnlySpan input) + { + const string whiteSpace = " "; + + var inputString = input.ToString(); + + // Use regex to match special characters with whitespace on one side + // and replace them with a single space + var result = _specialCharacterMatcher.Replace(inputString, match => + { + // Check if the match has whitespace on one side + bool hasLeadingWhitespace = match.Index > 0 && char.IsWhiteSpace(inputString[match.Index - 1]); + bool hasTrailingWhitespace = match.Index + match.Length < inputString.Length && char.IsWhiteSpace(inputString[match.Index + match.Length]); + if (hasLeadingWhitespace || hasTrailingWhitespace) + { + return whiteSpace; + } + return match.Value; + }); + + // Remove any extra spaces that might have been introduced + return _multiWhiteSpacesMatcher.Replace(result, whiteSpace).Trim(); } /// diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs index f80f3c9dd..8bcd5cd6b 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs @@ -103,6 +103,9 @@ namespace Flow.Launcher.Plugin.Sys private List Commands() { var results = new List(); + var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version); + var userDataPath = DataLocation.DataDirectory(); + var recycleBinFolder = "shell:RecycleBinFolder"; results.AddRange(new[] { new Result @@ -264,10 +267,11 @@ namespace Flow.Launcher.Plugin.Sys SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_openrecyclebin"), IcoPath = "Images\\openrecyclebin.png", Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe74d"), + CopyText = recycleBinFolder, Action = c => { { - System.Diagnostics.Process.Start("explorer", "shell:RecycleBinFolder"); + System.Diagnostics.Process.Start("explorer", recycleBinFolder); } return true; @@ -356,9 +360,10 @@ namespace Flow.Launcher.Plugin.Sys Title = "Open Log Location", SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_log_location"), IcoPath = "Images\\app.png", + CopyText = logPath, + AutoCompleteText = logPath, Action = c => { - var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version); context.API.OpenDirectory(logPath); return true; } @@ -368,6 +373,8 @@ namespace Flow.Launcher.Plugin.Sys Title = "Flow Launcher Tips", SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_docs_tips"), IcoPath = "Images\\app.png", + CopyText = Constant.Documentation, + AutoCompleteText = Constant.Documentation, Action = c => { context.API.OpenUrl(Constant.Documentation); @@ -379,9 +386,11 @@ namespace Flow.Launcher.Plugin.Sys Title = "Flow Launcher UserData Folder", SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_userdata_location"), IcoPath = "Images\\app.png", + CopyText = userDataPath, + AutoCompleteText = userDataPath, Action = c => { - context.API.OpenDirectory(DataLocation.DataDirectory()); + context.API.OpenDirectory(userDataPath); return true; } },