Closed al-ce closed 10 months ago
@Nimjii could you take a look at this if you have time?
Yeah, it looks good to me. Didn't really consider that, my bad. ^^
Yeah, it looks good to me. Didn't really consider that, my bad. ^^
No worries, I forgot too and it's probably a rare case. Most everyone would just set their telescope opts in the setup config. But maybe you'd want this for per-project/per-filetype mappings
Let telescope opts priority order be:
telescope
table from the user defined configSay you want call the picker with a function call instead of using
:Telescope hbac
buffers e.g.require('telescope').extensions.hbac.buffers(opts)
orrequire('hbac.telescope').pin_picker(opts)
. The currentparse_opts
function overwrites opts.mappings with the merged default_mappings + telescope_opts.mappings tables.The function prioritizes other options from a function call (e.g. if you set
sort_lastused = false
, it will override the config default), but it doesn't account for any potential value ofopts.mappings
before the assignment above.In 610a604 the priority order was as described above and currently in the README, but I forgot to check for that when we switched to the Telescope extension. This PR should restore that:
I also set the default telescope.mappings value to
{}
instead of nil to spare some 'check for nil' disjunctions (lua_ls and luacheck aren't complaining about that, do I have a bad config?).sample lazy.nvim config
```lua return { -- "axkirillov/hbac.nvim", "al-ce/hbac.nvim", branch = "telescope/config-override", opts = { telescope = { mappings = { i = { ["