-
-
Notifications
You must be signed in to change notification settings - Fork 457
Consistent handling of clipboard copying #2143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f019bb2
f992729
ed11cc2
d59bdff
488c8e8
c631895
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,14 +59,16 @@ public MainWindow() | |
|
|
||
| private void OnCopy(object sender, ExecutedRoutedEventArgs e) | ||
| { | ||
| if (QueryTextBox.SelectionLength == 0) | ||
| var result = _viewModel.Results.SelectedItem?.Result; | ||
| if (QueryTextBox.SelectionLength == 0 && result != null) | ||
| { | ||
| _viewModel.ResultCopy(string.Empty); | ||
| string copyText = result.CopyText; | ||
| _viewModel.ResultCopy(copyText); | ||
|
|
||
| } | ||
| else if (!string.IsNullOrEmpty(QueryTextBox.Text)) | ||
| { | ||
| _viewModel.ResultCopy(QueryTextBox.SelectedText); | ||
| System.Windows.Clipboard.SetText(QueryTextBox.SelectedText); | ||
|
Comment on lines
-69
to
+71
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we using this Clipboard method and not the viewmodel one?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copy selected text raises a notification, which is quite unnecessary. Maybe the right way is to remove notification for copy texts? And BTW does this PR affects clipboard manager plugins like ClipboardR?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This way avoids wasting time parsing if the text is a file and doesn't send a notification. I don't think anyone just copying text from the query text box wants or needs this.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes agree no need for notification. I missed the method being ResultCopy where this is copying query test.
I haven't used the plugin, does it just access copied data or does it also do copy?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I created an issue to let the author know about this change. |
||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.