Skip to content

feat: add snacks.nvim picker integration#720

Merged
jellydn merged 4 commits intoCopilotC-Nvim:mainfrom
tku137:snacks-picker
Jan 25, 2025
Merged

feat: add snacks.nvim picker integration#720
jellydn merged 4 commits intoCopilotC-Nvim:mainfrom
tku137:snacks-picker

Conversation

@tku137
Copy link
Copy Markdown
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

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.
Copy link
Copy Markdown

Copilot AI left a comment

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

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
Copy Markdown
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
Copy Markdown
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
@jellydn
Copy link
Copy Markdown
Contributor

jellydn commented Jan 25, 2025

@all-contributors add @tku137 for code.

@allcontributors
Copy link
Copy Markdown
Contributor

@jellydn

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

@Uzaaft
Copy link
Copy Markdown

Uzaaft commented Jan 25, 2025

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

@tku137
Copy link
Copy Markdown
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
Copy Markdown

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.

4 participants