feat: add snacks.nvim picker integration#720
Merged
jellydn merged 4 commits intoCopilotC-Nvim:mainfrom Jan 25, 2025
Merged
Conversation
Adds a new integration with snacks.nvim to provide a picker interface for selecting prompt actions in CopilotChat. This allows users to open the prompt actions picker with snacks.nvim picker.
Updates the snacks picker integration to properly display previews for each action by adding a preview field to the selection items and configuring the correct preview handler in the picker layout.
1 task
Change the picker's selection handling from multiple to single item mode by replacing selected() with current() method. This way, only the currently highighted item is picked. Unfortunately, snacks.nvim's picker doesn't support disabling multi-select, so this is a much better implementation.
Contributor
Author
|
Added better handling of selected prompts: only the highlighted prompt is selected. Unfortunately, snacks.nvim does not provide a way to disable multi-select (yet), so we still can select multiple prompts. Now, only the highlighted is inserted, making handling much clearer. |
jellydn
approved these changes
Jan 25, 2025
Contributor
|
@all-contributors add @tku137 for code. |
Contributor
|
I've put up a pull request to add @tku137! 🎉 |
|
Would it be possible to get docs for this? Blocking AstroNvim/astrocommunity#1333 |
Contributor
Author
Done here #726 |
|
Awesome, you guys are amazing |
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.
This adds an integration for the new snacks.nvim picker to be used when picking prompt actions with prompt preview:
