Skip to content

Commit db6e541

Browse files
committed
Handle clipboard paste event if text
1 parent 2107402 commit db6e541

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ private void OnCopy(object sender, ExecutedRoutedEventArgs e)
7171
App.API.CopyToClipboard(QueryTextBox.SelectedText, showDefaultNotification: false);
7272
}
7373
}
74+
75+
private void OnPaste(object sender, ExecutedRoutedEventArgs e)
76+
{
77+
if (System.Windows.Clipboard.ContainsText())
78+
{
79+
_viewModel.QueryText = System.Windows.Clipboard.GetText().Replace("\n", String.Empty).Replace("\r", String.Empty);
80+
e.Handled = true;
81+
}
82+
}
7483

7584
private async void OnClosing(object sender, CancelEventArgs e)
7685
{

0 commit comments

Comments
 (0)