-
Notifications
You must be signed in to change notification settings - Fork 351
added hint for multiline triple backtick code block detector #3327
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
base: main
Are you sure you want to change the base?
Conversation
evanliu048
left a comment
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 is expected behavior, not a bug. When the user types ``` and presses Enter, the validator correctly treats it as an unclosed code block and returns Incomplete, moving the cursor to the next line to wait for input. I don’t currently see a strong reason to remove this check
|
I think we may then need to update the documentation because right now |
The documentation you pointed to covers commands, while ``` isn’t a command — it’s just a syntax check. So it’s expected that it doesn’t appear there. That said, from a usability perspective, I agree we could improve the experience. Instead of silently waiting for the closing code fence, we might consider showing a hint when the user opens a code block — something like a clear UI indicator that Q is now in multiline mode and waiting for the closing backticks. That would avoid confusion when users forget to close the block |
|
I have successfully added the multiline hint |
I like the UX improvement! One concern though: pressing → (right arrow) currently fills in "in multiline mode, waiting for closing backticks ```" as input text. This seems unintended since it's a status hint, not a completion suggestion |
|
Thank you! Good point, I made it so that the hint will not be used as part of an autocompletion suggestion any longer. |
Issue #, if available:
#3271
Description of changes:
Since the triple backtick detector results in unexpected hangs, I added a multiline hint when an unclosed triple backtick is present in the user prompt. I also made it so that the hint will not be incorrectly used for autocompletion.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.