feat(builtin.colorscheme): add option ignore_builtins (#3155)
This commit is contained in:
@@ -1482,6 +1482,8 @@ builtin.colorscheme({opts}) *telescope.builtin.colorscheme()*
|
|||||||
explicitly make available to telescope
|
explicitly make available to telescope
|
||||||
(default: {})
|
(default: {})
|
||||||
{enable_preview} (boolean) if true, will preview the selected color
|
{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()*
|
builtin.marks({opts}) *telescope.builtin.marks()*
|
||||||
|
|||||||
@@ -993,6 +993,19 @@ internal.colorscheme = function(opts)
|
|||||||
end, vim.fn.getcompletion("", "color"))
|
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
|
local previewer
|
||||||
if opts.enable_preview then
|
if opts.enable_preview then
|
||||||
-- define previewer
|
-- 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
|
---@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 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 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
|
builtin.colorscheme = require_on_exported_call("telescope.builtin.__internal").colorscheme
|
||||||
|
|
||||||
--- Lists vim marks and their value, jumps to the mark on `<cr>`
|
--- Lists vim marks and their value, jumps to the mark on `<cr>`
|
||||||
|
|||||||
Reference in New Issue
Block a user