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() opts = function()
local defaults = require("outline.config").defaults local defaults = require("outline.config").defaults
local opts = { local opts = {
symbols = {}, symbols = {
symbol_blacklist = {}, icons = {},
filter = LazyVim.config.kind_filter,
},
keymaps = { keymaps = {
up_and_jump = "<up>", up_and_jump = "<up>",
down_and_jump = "<down>", down_and_jump = "<down>",
}, },
} }
local filter = LazyVim.config.kind_filter
if type(filter) == "table" then for kind, symbol in pairs(defaults.symbols.icons) do
filter = filter.default opts.symbols.icons[kind] = {
if type(filter) == "table" then icon = LazyVim.config.icons.kinds[kind] or symbol.icon,
for kind, symbol in pairs(defaults.symbols) do hl = symbol.hl,
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
end end
return opts return opts
end, end,