diff --git a/lua/telescope/_extensions/repo.lua b/lua/telescope/_extensions/repo.lua index 60226c9..6f8179b 100644 --- a/lua/telescope/_extensions/repo.lua +++ b/lua/telescope/_extensions/repo.lua @@ -1,10 +1,12 @@ local main = require("telescope._extensions.repo.main") +local r_config = require("telescope._extensions.repo.config") local health = require("telescope._extensions.repo.health") local fallback_error = { "Falling back to `:Telescope repo list`, but this behavior may change in the future" } return require("telescope").register_extension({ health = health.check, + setup = r_config.setup, exports = { list = main.list, cached_list = main.cached_list, diff --git a/lua/telescope/_extensions/repo/config.lua b/lua/telescope/_extensions/repo/config.lua new file mode 100644 index 0000000..edf1878 --- /dev/null +++ b/lua/telescope/_extensions/repo/config.lua @@ -0,0 +1,9 @@ +local M = {} + +M.values = {} + +M.setup = function (opts) + M.values = opts +end + +return M diff --git a/lua/telescope/_extensions/repo/main.lua b/lua/telescope/_extensions/repo/main.lua index e8321dc..46743b0 100644 --- a/lua/telescope/_extensions/repo/main.lua +++ b/lua/telescope/_extensions/repo/main.lua @@ -17,6 +17,7 @@ local Path = require("plenary.path") local utils = require("telescope._extensions.repo.utils") local list = require("telescope._extensions.repo.list") local cached_list = require("telescope._extensions.repo.cached_list") +local r_config = require("telescope._extensions.repo.config") local M = {} @@ -187,7 +188,7 @@ end -- List of repos built using locate (or variants) M.cached_list = function(opts) - opts = opts or {} + opts = vim.tbl_deep_extend("force", r_config.values.cached_list or {}, opts or {}) opts.entry_maker = t_utils.get_lazy_default(opts.entry_maker, gen_from_locate_wrapper, opts) local locate_command = cached_list.prepare_command(opts) @@ -196,7 +197,7 @@ end -- Always up to date list of repos built using fd M.list = function(opts) - opts = opts or {} + opts = vim.tbl_deep_extend("force", r_config.values.list or {}, opts or {}) opts.entry_maker = t_utils.get_lazy_default(opts.entry_maker, gen_from_fd, opts) local fd_command = list.prepare_command(opts)