fix(outline): use the correct symbols and filter config format

The symbols-outline extra was removed in favor of outline.nvim, but the configuration for symbols is not backwards-compatible (https://github.com/hedyhli/outline.nvim/issues/12).

This fixes the configuration for the symbols icons and filter to be usable by outline.nvim.
This commit is contained in:
~hedy 2024-07-05 20:27:50 +08:00 committed by GitHub
parent 76b41cdec4
commit 487d44c049
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,28 +14,21 @@ return {
opts = function()
local defaults = require("outline.config").defaults
local opts = {
symbols = {},
symbol_blacklist = {},
symbols = {
icons = {},
filter = LazyVim.config.kind_filter,
},
keymaps = {
up_and_jump = "<up>",
down_and_jump = "<down>",
},
}
local filter = LazyVim.config.kind_filter
if type(filter) == "table" then
filter = filter.default
if type(filter) == "table" then
for kind, symbol in pairs(defaults.symbols) do
opts.symbols[kind] = {
icon = LazyVim.config.icons.kinds[kind] or symbol.icon,
hl = symbol.hl,
}
if not vim.tbl_contains(filter, kind) then
table.insert(opts.symbol_blacklist, kind)
end
end
end
for kind, symbol in pairs(defaults.symbols.icons) do
opts.symbols.icons[kind] = {
icon = LazyVim.config.icons.kinds[kind] or symbol.icon,
hl = symbol.hl,
}
end
return opts
end,