Skip to content

Commit

Permalink
Merge pull request #2536 from Flow-Launcher/dev
Browse files Browse the repository at this point in the history
Release 1.17.1
  • Loading branch information
jjw24 authored Feb 5, 2024
2 parents cec8a73 + 73f2c3b commit b623295
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
1 change: 0 additions & 1 deletion Flow.Launcher/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@
Visibility="Visible">
<TextBox.CommandBindings>
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />
<CommandBinding Command="ApplicationCommands.Paste" Executed="OnPaste" />
</TextBox.CommandBindings>
<TextBox.ContextMenu>
<ContextMenu MinWidth="160">
Expand Down
16 changes: 11 additions & 5 deletions Flow.Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -50,7 +51,8 @@ public MainWindow(Settings settings, MainViewModel mainVM)
_settings = settings;

InitializeComponent();
InitializePosition();
InitializePosition();
DataObject.AddPastingHandler(QueryTextBox, OnPaste);
}

public MainWindow()
Expand All @@ -72,12 +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)
{
_viewModel.ChangeQueryText(System.Windows.Clipboard.GetText().Replace("\n", String.Empty).Replace("\r", String.Empty));
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;
}
}

Expand Down
6 changes: 6 additions & 0 deletions Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SearchResult> ExecuteWindowsIndexSearchAsync(string indexQueryString, string connectionString, [EnumeratorCancellation] CancellationToken token)
{
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.Explorer/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '1.17.0.{build}'
version: '1.17.1.{build}'

init:
- ps: |
Expand Down

0 comments on commit b623295

Please sign in to comment.