QuickSelectArgs: optionally bypass custom action on paste #6405
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
QuickSelect will paste the selection when the capitalized selection form is used. This is fine on its own when dealing with the default actions (lower=copy upper=copy+paste), but can cause odd behavior for QuickSelectArgs when a custom action is defined.
The example used in the docs for QuickSelectArgs (opening a URL) I believe is one of those cases where we'd want to perform a paste but NOT perform the action when a capitalized selection is used. Without the option, the user would experience both a paste of the URL as well as their browser opening the link.
In this PR I'm proposing the addition of a
paste_performs_action
override option for QuickSelectArgs which will allow users to disable this behavior. For the URL open case, when disabled, capital selection would only paste and not open the URL. I've defaulted the option totrue
to persist the current behavior.