mirror of
https://github.com/harivansh-afk/forge.nvim.git
synced 2026-04-17 23:01:34 +00:00
refactor(picker): canonicalize backend names into single table
Problem: picker backend names were hard-coded as string literals in `picker/init.lua`, `health.lua`, and `init.lua` validation, making them easy to get out of sync. Solution: export `backends` and `detect_order` from `forge.picker` and reference them in health check and config validation instead of duplicating the name strings.
This commit is contained in:
parent
97698c2af1
commit
ac8db6851f
3 changed files with 13 additions and 17 deletions
|
|
@ -725,8 +725,9 @@ function M.config()
|
|||
cfg.keys = false
|
||||
end
|
||||
|
||||
local picker_backends = require('forge.picker').backends
|
||||
vim.validate('forge.picker', cfg.picker, function(v)
|
||||
return v == 'auto' or v == 'fzf-lua' or v == 'telescope' or v == 'snacks'
|
||||
return v == 'auto' or picker_backends[v] ~= nil
|
||||
end, "'auto', 'fzf-lua', 'telescope', or 'snacks'")
|
||||
vim.validate('forge.sources', cfg.sources, 'table')
|
||||
vim.validate('forge.keys', cfg.keys, function(v)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue