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

feat: add snacks.nvim picker integration #720

Merged
merged 4 commits into from
Jan 25, 2025

Conversation

tku137
Copy link
Contributor

@tku137 tku137 commented Jan 19, 2025

This adds an integration for the new snacks.nvim picker to be used when picking prompt actions with prompt preview:
image

Tony Fischer (tku137) added 2 commits January 19, 2025 19:05
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.

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • lua/CopilotChat/integrations/snacks.lua: Language not supported
Tony Fischer (tku137) added 2 commits January 21, 2025 15:54
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.
@tku137
Copy link
Contributor Author

tku137 commented Jan 21, 2025

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.

Copy link
Contributor

@jellydn jellydn left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @tku137.

@jellydn jellydn merged commit d30b7af into CopilotC-Nvim:main Jan 25, 2025
1 check passed
@jellydn
Copy link
Contributor

jellydn commented Jan 25, 2025

@all-contributors add @tku137 for code.

Copy link
Contributor

@jellydn

I've put up a pull request to add @tku137! 🎉

@Uzaaft
Copy link

Uzaaft commented Jan 25, 2025

Would it be possible to get docs for this? Blocking AstroNvim/astrocommunity#1333

@tku137
Copy link
Contributor Author

tku137 commented Jan 25, 2025

Would it be possible to get docs for this? Blocking AstroNvim/astrocommunity#1333

Done here #726

@Uzaaft
Copy link

Uzaaft commented Jan 25, 2025

Awesome, you guys are amazing

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.

3 participants