-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add "CopyToClipboard" command to ConfirmationController
#4810
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
Add "CopyToClipboard" command to ConfirmationController
#4810
Conversation
e927974
to
c544f39
Compare
Nice, seems useful. Two things:
|
Thanks for the feedback!
I'll look into it.
That's right!
So how about adding an implementation like this first, then merging this PR, and then deleting unnecessary key bindings? |
I found the cause. |
f60838c
to
494edfc
Compare
After merging #4819, I will reopen this PR. |
da55e1f
to
e74f515
Compare
@stefanhaller And this is a message when I used |
e74f515
to
196e5bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks mostly good. I added a fixup to disable the command for editable prompts (e.g. new branch name); while it would technically be possible to copy the branch name that you just typed, I don't think this is the intended use, and I'd rather not see the extra keybinding appear in the status bar in this case.
Also took that opportunity to move the handler to a method.
Finally, I added another fixup to add an integration test.
I hope you don't mind my changing your PRs so much, but for me this is a more efficient way of working than to tell you what I would like to see changed.
return err | ||
} | ||
|
||
self.c.Toast(fmt.Sprintf("Window content %s", self.c.Tr.CopiedToClipboard)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be i18n'ed too. I added 79f1d7c to do this. We can't use the existing Tr.CopiedToClipboard
text here, this is only for hashes or branch names etc., so we need to add a new text for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope you don't mind my changing your PRs so much, but for me this is a more efficient way of working than to tell you what I would like to see changed.
Thank you for your thoughtful consideration.
It's totally fine for me.
Your support actually helped make the code much better. Thank you so much. And your changes looks good to me too.
This was needed in an earlier version of the test, when we asserted the file content in a more complicated way. It should have been removed in caca62b.
196e5bf
to
fc84b77
Compare
PR Description
Sometimes, I want to copy the error message to clipboard to search google or ask to LLM about the error message.
So I added CopyToClipboard command to
ConfirmationController
and I have confirmed that this command copies the content of the window to the clipboard.Please check if the PR fulfills these requirements
go generate ./...
)If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)