Skip to content

Commit b623295

Browse files
authored
Merge pull request #2536 from Flow-Launcher/dev
Release 1.17.1
2 parents cec8a73 + 73f2c3b commit b623295

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@
221221
Visibility="Visible">
222222
<TextBox.CommandBindings>
223223
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />
224-
<CommandBinding Command="ApplicationCommands.Paste" Executed="OnPaste" />
225224
</TextBox.CommandBindings>
226225
<TextBox.ContextMenu>
227226
<ContextMenu MinWidth="160">

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
using Key = System.Windows.Input.Key;
2626
using System.Media;
2727
using static Flow.Launcher.ViewModel.SettingWindowViewModel;
28+
using DataObject = System.Windows.DataObject;
2829

2930
namespace Flow.Launcher
3031
{
@@ -50,7 +51,8 @@ public MainWindow(Settings settings, MainViewModel mainVM)
5051
_settings = settings;
5152

5253
InitializeComponent();
53-
InitializePosition();
54+
InitializePosition();
55+
DataObject.AddPastingHandler(QueryTextBox, OnPaste);
5456
}
5557

5658
public MainWindow()
@@ -72,12 +74,16 @@ private void OnCopy(object sender, ExecutedRoutedEventArgs e)
7274
}
7375
}
7476

75-
private void OnPaste(object sender, ExecutedRoutedEventArgs e)
77+
private void OnPaste(object sender, DataObjectPastingEventArgs e)
7678
{
77-
if (System.Windows.Clipboard.ContainsText())
79+
var isText = e.SourceDataObject.GetDataPresent(System.Windows.DataFormats.UnicodeText, true);
80+
if (isText)
7881
{
79-
_viewModel.ChangeQueryText(System.Windows.Clipboard.GetText().Replace("\n", String.Empty).Replace("\r", String.Empty));
80-
e.Handled = true;
82+
var text = e.SourceDataObject.GetData(System.Windows.DataFormats.UnicodeText) as string;
83+
text = text.Replace(Environment.NewLine, " ");
84+
DataObject data = new DataObject();
85+
data.SetData(System.Windows.DataFormats.UnicodeText, text);
86+
e.DataObject = data;
8187
}
8288
}
8389

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ private void AutocompleteQuery()
259259
}
260260
else if (!string.IsNullOrEmpty(SelectedResults.SelectedItem?.QuerySuggestionText))
261261
{
262+
var defaultSuggestion = SelectedResults.SelectedItem.QuerySuggestionText;
263+
// check if result.actionkeywordassigned is empty
264+
if (!string.IsNullOrEmpty(result.ActionKeywordAssigned))
265+
{
266+
autoCompleteText = $"{result.ActionKeywordAssigned} {defaultSuggestion}";
267+
}
262268
autoCompleteText = SelectedResults.SelectedItem.QuerySuggestionText;
263269
}
264270

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal static class WindowsIndex
1616
{
1717

1818
// Reserved keywords in oleDB
19-
private static Regex _reservedPatternMatcher = new(@"[`\@\@\#\#\*\^,\&\&\/\\\$\%_;\[\]]+", RegexOptions.Compiled);
19+
private static Regex _reservedPatternMatcher = new(@"^[`\@\@\#\#\*\^,\&\&\/\\\$\%_;\[\]]+$", RegexOptions.Compiled);
2020

2121
private static async IAsyncEnumerable<SearchResult> ExecuteWindowsIndexSearchAsync(string indexQueryString, string connectionString, [EnumeratorCancellation] CancellationToken token)
2222
{

Plugins/Flow.Launcher.Plugin.Explorer/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Name": "Explorer",
1111
"Description": "Find and manage files and folders via Windows Search or Everything",
1212
"Author": "Jeremy Wu",
13-
"Version": "3.1.4",
13+
"Version": "3.1.5",
1414
"Language": "csharp",
1515
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
1616
"ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '1.17.0.{build}'
1+
version: '1.17.1.{build}'
22

33
init:
44
- ps: |

0 commit comments

Comments
 (0)