feat(context): add inline visual selection insertion#326
Merged
sudo-tee merged 3 commits intosudo-tee:mainfrom Mar 17, 2026
Merged
Conversation
Adds a new command and API to insert the current visual selection as a formatted code block directly into the input buffer. This includes a new `add_visual_selection_inline` function, a corresponding keymap, and a helper to build the formatted text. Unit tests are provided to ensure correct formatting and error handling for edge cases.
sudo-tee
reviewed
Mar 17, 2026
Owner
|
I like the idea but I would prefer not to hardcode the string Thanks for the PR |
Contributor
Author
|
@sudo-tee yeah, nice point, i will modify the code, it is fine for me |
Update the inline visual selection text to use bolded file path formatting (**`path/to/file`**) instead of the previous "Here is some code from" prefix. Adjust unit tests to match the new output format. This change makes the inserted context more visually distinct and concise.
Owner
|
Thanks for the Fix One last thing can you update the README default config to include the new keymap ? Thanks a lot :) |
Add new action `add_visual_selection_inline` with keymap `<leader>oY` to insert visually selected code directly into the input buffer as a Markdown code block, prefixed with the file path. Updates documentation with usage details and example. Leaves cursor in normal mode for prompt editing.
Owner
|
Awesome thanks a lot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a new command and API to insert the current visual selection as a formatted code block directly into the input buffer. This includes a new
add_visual_selection_inlinefunction, a corresponding keymap, and a helper to build the formatted text. Unit tests are provided to ensure correct formatting and error handling for edge cases.