Fix pressing Ctrl-C in composer not copying timestamp to system clipboard with empty selection #24171
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.
As noted on discord.
As noted in the following discussion there, it's a weird one. UX-wise the copy item in editor menu shouldn't be unblocked while there is nothing selected (every single other editor does this), which is what
CanCopy
was responsible for (and was why this was broken for no selection despite the underlying method supporting this). I think the timestamp copy thing ideally would be a separate action but can't be due to mapper muscle memory so I'm just making work in a very hidden way for those that are used to it already.This also nukes the
Cut
/PerformCut
et al. structure because while you technically could fix it just by overridingCopy()
, having bothCopy()
andPerformCopy()
overridden is......... not good.No tests here because headless hosts don't have a clipboard to set, so it is currently untestable.