-
Notifications
You must be signed in to change notification settings - Fork 409
Description
Did you check docs and existing issues?
- Make sure to search for a solution in old issues before posting a new one.
- Learn at least a minimum of Markdown formatting (https://guides.github.com/features/mastering-markdown).
Is your feature request related to a problem?
Caution
I don't use this plugin myself.
It’s not possible to reliably extend the plugin’s vimtex.snacks picker (require("vimtex.snacks").toc) because it explicitly defines options that override snacks sources.vimtex_toc configuration. This prevents customization of certain fields, such as layout.preset.
Describe the solution you’d like (good)
Register the picker similarly to how noice.nvim does it — by extending Snacks.picker.sources table instead of passing options directly to Snacks.picker.pick.
Tip
Use the picker’s finder option to populate the items based on the picker.layers option (extend snacks.picker.Config). See noice/integrations/snacks.lua.
Describe alternatives you’ve considered
A possible workaround is to allow passing a snacks.picker.Config options directly to require("vimtex.snacks").toc(<options>) via an argument:
---@class VimtexSnacksOptions: snacks.picker.Config
---@field layers? string -- The layers to filter, e.g., a substring of "ctli"
--- corresponds to content, todos, labels, and includes.But I still recommend using the first (good) approach, binding require("vimtex.snacks").toc to Snacks.picker.vimtex_toc.
Additional context
Thanks to @dpetka2001 for identifying the issue and suggesting a solution.
See the original discussion: folke/snacks.nvim#2433 (comment)