feat(builtin.colorscheme): add option ignore_builtins (#3155)
This commit is contained in:
@@ -1478,10 +1478,12 @@ builtin.colorscheme({opts}) *telescope.builtin.colorscheme()*
|
||||
{opts} (table) options to pass to the picker
|
||||
|
||||
Options: ~
|
||||
{colors} (table) a list of additional colorschemes to
|
||||
explicitly make available to telescope
|
||||
(default: {})
|
||||
{enable_preview} (boolean) if true, will preview the selected color
|
||||
{colors} (table) a list of additional colorschemes to
|
||||
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()*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>`
|
||||
|
||||
Reference in New Issue
Block a user