From 8f5c7e1f96401a1a2f7cb71c548d29429f6fb3ab Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Sun, 4 Feb 2024 10:12:21 -0500 Subject: [PATCH 1/7] Prepend actionkeyword to suggestions --- Flow.Launcher/ViewModel/MainViewModel.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index c4b13abb0cd..db481d4109e 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -259,6 +259,12 @@ private void AutocompleteQuery() } else if (!string.IsNullOrEmpty(SelectedResults.SelectedItem?.QuerySuggestionText)) { + var defaultSuggestion = SelectedResults.SelectedItem.QuerySuggestionText; + // check if result.actionkeywordassigned is empty + if (!string.IsNullOrEmpty(result.ActionKeywordAssigned)) + { + autoCompleteText = $"{result.ActionKeywordAssigned} {defaultSuggestion}"; + } autoCompleteText = SelectedResults.SelectedItem.QuerySuggestionText; } From 7ada82afd13edc846a65d7dff0cb9fa7917df4c3 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Sun, 4 Feb 2024 10:23:37 -0500 Subject: [PATCH 2/7] Prepend clipboard to query --- Flow.Launcher/MainWindow.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 7d1a68125b0..e61b32a9450 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -76,7 +76,8 @@ private void OnPaste(object sender, ExecutedRoutedEventArgs e) { if (System.Windows.Clipboard.ContainsText()) { - _viewModel.ChangeQueryText(System.Windows.Clipboard.GetText().Replace("\n", String.Empty).Replace("\r", String.Empty)); + var clipboardText = System.Windows.Clipboard.GetText().Replace("\r\n", " "); + QueryTextBox.SelectedText = clipboardText; e.Handled = true; } } From e9dba45f82e795691bc24e1b6b1f0a943a3b2625 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Sun, 4 Feb 2024 14:33:00 -0500 Subject: [PATCH 3/7] Use caret position for inserted text --- Flow.Launcher/MainWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index e61b32a9450..36d852a269b 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -77,7 +77,7 @@ private void OnPaste(object sender, ExecutedRoutedEventArgs e) if (System.Windows.Clipboard.ContainsText()) { var clipboardText = System.Windows.Clipboard.GetText().Replace("\r\n", " "); - QueryTextBox.SelectedText = clipboardText; + _viewModel.ChangeQueryText(QueryTextBox.Text.Insert(QueryTextBox.CaretIndex, clipboardText)); e.Handled = true; } } From b77c9aad13719924c4772c3895c35add01ccdd9c Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Sun, 4 Feb 2024 16:02:53 -0500 Subject: [PATCH 4/7] Use DataObject handler method --- Flow.Launcher/MainWindow.xaml | 1 - Flow.Launcher/MainWindow.xaml.cs | 17 +++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index b65fbc7bb42..88e95aa692f 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -221,7 +221,6 @@ Visibility="Visible"> - diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 36d852a269b..e90582b3166 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -25,6 +25,7 @@ using Key = System.Windows.Input.Key; using System.Media; using static Flow.Launcher.ViewModel.SettingWindowViewModel; +using DataObject = System.Windows.DataObject; namespace Flow.Launcher { @@ -50,7 +51,8 @@ public MainWindow(Settings settings, MainViewModel mainVM) _settings = settings; InitializeComponent(); - InitializePosition(); + InitializePosition(); + DataObject.AddPastingHandler(QueryTextBox, OnPaste); } public MainWindow() @@ -72,13 +74,16 @@ private void OnCopy(object sender, ExecutedRoutedEventArgs e) } } - private void OnPaste(object sender, ExecutedRoutedEventArgs e) + private void OnPaste(object sender, DataObjectPastingEventArgs e) { - if (System.Windows.Clipboard.ContainsText()) + var isText = e.SourceDataObject.GetDataPresent(System.Windows.DataFormats.UnicodeText, true); + if (isText) { - var clipboardText = System.Windows.Clipboard.GetText().Replace("\r\n", " "); - _viewModel.ChangeQueryText(QueryTextBox.Text.Insert(QueryTextBox.CaretIndex, clipboardText)); - e.Handled = true; + var text = e.SourceDataObject.GetData(System.Windows.DataFormats.UnicodeText) as string; + text = text.Replace(Environment.NewLine, " "); + DataObject data = new DataObject(); + data.SetData(System.Windows.DataFormats.UnicodeText, text); + e.DataObject = data; } } From ca6a6dca4b9f2b4302863319f2e944b79f68db67 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Sun, 4 Feb 2024 20:06:47 -0500 Subject: [PATCH 5/7] Revert regex to original Windows Index will not show results otherwise. --- .../Search/WindowsIndex/WindowsIndex.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs index de565f9bd03..66230937cd3 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs @@ -16,7 +16,7 @@ internal static class WindowsIndex { // Reserved keywords in oleDB - private static Regex _reservedPatternMatcher = new(@"[`\@\@\#\#\*\^,\&\&\/\\\$\%_;\[\]]+", RegexOptions.Compiled); + private static Regex _reservedPatternMatcher = new(@"^[`\@\@\#\#\*\^,\&\&\/\\\$\%_;\[\]]+$", RegexOptions.Compiled); private static async IAsyncEnumerable ExecuteWindowsIndexSearchAsync(string indexQueryString, string connectionString, [EnumeratorCancellation] CancellationToken token) { From 394916163e984f51eac01e064d257954d945a048 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 5 Feb 2024 18:04:02 +1100 Subject: [PATCH 6/7] version bump flow --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 195ab1bc132..602efba0efe 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: '1.17.0.{build}' +version: '1.17.1.{build}' init: - ps: | From d8afdd3ecca3321362f605051e8e3401a2fe567d Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 5 Feb 2024 18:04:24 +1100 Subject: [PATCH 7/7] version bump Explorer plugin --- Plugins/Flow.Launcher.Plugin.Explorer/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json index 53d4049e6c4..fac4621b05d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json @@ -10,7 +10,7 @@ "Name": "Explorer", "Description": "Find and manage files and folders via Windows Search or Everything", "Author": "Jeremy Wu", - "Version": "3.1.4", + "Version": "3.1.5", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",