mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 09:18:51 +02:00
feat: disable kind_filter for markdown and help
This commit is contained in:
parent
57b504b9e8
commit
782fe0bef0
2 changed files with 21 additions and 9 deletions
|
@ -92,7 +92,7 @@ local defaults = {
|
||||||
Variable = " ",
|
Variable = " ",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
---@type table<string, string[]>?
|
---@type table<string, string[]|boolean>?
|
||||||
kind_filter = {
|
kind_filter = {
|
||||||
default = {
|
default = {
|
||||||
"Class",
|
"Class",
|
||||||
|
@ -109,6 +109,8 @@ local defaults = {
|
||||||
"Struct",
|
"Struct",
|
||||||
"Trait",
|
"Trait",
|
||||||
},
|
},
|
||||||
|
markdown = false,
|
||||||
|
help = false,
|
||||||
-- you can specify a different filter for each filetype
|
-- you can specify a different filter for each filetype
|
||||||
lua = {
|
lua = {
|
||||||
"Class",
|
"Class",
|
||||||
|
@ -214,7 +216,11 @@ function M.get_kind_filter(buf)
|
||||||
if M.kind_filter == false then
|
if M.kind_filter == false then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
return M.kind_filter[ft] or M.kind_filter.default
|
if M.kind_filter[ft] == false then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
---@diagnostic disable-next-line: return-type-mismatch
|
||||||
|
return type(M.kind_filter) == "table" and type(M.kind_filter.default) == "table" and M.kind_filter.default or nil
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param name "autocmds" | "options" | "keymaps"
|
---@param name "autocmds" | "options" | "keymaps"
|
||||||
|
|
|
@ -12,16 +12,22 @@ return {
|
||||||
symbols = {},
|
symbols = {},
|
||||||
symbol_blacklist = {},
|
symbol_blacklist = {},
|
||||||
}
|
}
|
||||||
|
local filter = Config.kind_filter
|
||||||
|
|
||||||
|
if type(filter) == "table" then
|
||||||
|
filter = filter.default
|
||||||
|
if type(filter) == "table" then
|
||||||
for kind, symbol in pairs(defaults.symbols) do
|
for kind, symbol in pairs(defaults.symbols) do
|
||||||
opts.symbols[kind] = {
|
opts.symbols[kind] = {
|
||||||
icon = Config.icons.kinds[kind] or symbol.icon,
|
icon = Config.icons.kinds[kind] or symbol.icon,
|
||||||
hl = symbol.hl,
|
hl = symbol.hl,
|
||||||
}
|
}
|
||||||
if not vim.tbl_contains(Config.kind_filter.default, kind) then
|
if not vim.tbl_contains(filter, kind) then
|
||||||
table.insert(opts.symbol_blacklist, kind)
|
table.insert(opts.symbol_blacklist, kind)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
return opts
|
return opts
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue