Skip to content
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

Added "B" shortcut to copy last block of code in multiline mode #208

Merged
merged 2 commits into from Feb 4, 2024

Conversation

guhitb
Copy link
Contributor

@guhitb guhitb commented Feb 4, 2024

I use tgpt -m to generate and refine code, and I need to copy code blocks pretty frequently. This PR adds a shortcut ("B") to copy the last code block in the last response of multiline mode.

output.mp4

main.go Outdated
@@ -245,8 +245,7 @@ func main() {
// Multiline interactive
/////////////////////

fmt.Print("\nPress Tab to submit, Ctrl + C to exit, Esc to unfocus, i to focus. When unfocused, press p to paste and c to copy response\n")

fmt.Print("\nPress Tab to submit, Ctrl + C to exit, Esc to unfocus, i to focus. When unfocused, press p to paste, c to copy response, bc to copy last code block in response\n")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to update the instructions, thanks for catching that. I was prototyping syntax like "b4c" to copy the 4th block, but discarded it due to complexity of multi-character commands.

@aandrew-me aandrew-me merged commit cf8b60c into aandrew-me:main Feb 4, 2024
@guhitb guhitb deleted the block-copy branch February 4, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants