feat(builtin.colorscheme): add option ignore_builtins (#3155)

This commit is contained in:
Chris Grieser
2024-06-15 15:29:34 +02:00
committed by GitHub
parent 19584e666f
commit 77cab9ad63
3 changed files with 20 additions and 4 deletions

View File

@@ -1482,6 +1482,8 @@ builtin.colorscheme({opts}) *telescope.builtin.colorscheme()*
explicitly make available to telescope
(default: {})
{enable_preview} (boolean) if true, will preview the selected color
{ignore_builtins} (boolean) if true, builtin colorschemes are not
listed
builtin.marks({opts}) *telescope.builtin.marks()*

View File

@@ -993,6 +993,19 @@ internal.colorscheme = function(opts)
end, vim.fn.getcompletion("", "color"))
)
if opts.ignore_builtins then
-- stylua: ignore
local builtins = {
"blue", "darkblue", "default", "delek", "desert", "elflord", "evening",
"habamax", "industry", "koehler", "lunaperche", "morning", "murphy",
"pablo", "peachpuff", "quiet", "retrobox", "ron", "shine", "slate",
"sorbet", "torte", "vim", "wildcharm", "zaibatsu", "zellner",
}
colors = vim.tbl_filter(function(color)
return not vim.tbl_contains(builtins, color)
end, colors)
end
local previewer
if opts.enable_preview then
-- define previewer

View File

@@ -357,6 +357,7 @@ builtin.buffers = require_on_exported_call("telescope.builtin.__internal").buffe
---@param opts table: options to pass to the picker
---@field colors table: a list of additional colorschemes to explicitly make available to telescope (default: {})
---@field enable_preview boolean: if true, will preview the selected color
---@field ignore_builtins boolean: if true, builtin colorschemes are not listed
builtin.colorscheme = require_on_exported_call("telescope.builtin.__internal").colorscheme
--- Lists vim marks and their value, jumps to the mark on `<cr>`