mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #2465 from Flow-Launcher/strip-newlines-for-multi-line-paste
Strip newlines for multi line paste
This commit is contained in:
commit
6aeec622ae
2 changed files with 10 additions and 0 deletions
|
|
@ -221,6 +221,7 @@
|
|||
Visibility="Visible">
|
||||
<TextBox.CommandBindings>
|
||||
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />
|
||||
<CommandBinding Command="ApplicationCommands.Paste" Executed="OnPaste" />
|
||||
</TextBox.CommandBindings>
|
||||
<TextBox.ContextMenu>
|
||||
<ContextMenu MinWidth="160">
|
||||
|
|
|
|||
|
|
@ -71,6 +71,15 @@ namespace Flow.Launcher
|
|||
App.API.CopyToClipboard(QueryTextBox.SelectedText, showDefaultNotification: false);
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnClosing(object sender, CancelEventArgs e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue