fix(edgy): neo-tree. See #3667

This commit is contained in:
Folke Lemaitre 2024-06-15 15:21:10 +02:00
parent 67616b9520
commit f22a6022c4
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -96,28 +96,21 @@ return {
} }
-- only add neo-tree sources if they are enabled in config -- only add neo-tree sources if they are enabled in config
if vim.list_contains(LazyVim.opts("neo-tree").sources, "buffers") then local neotree_opts = LazyVim.opts("neo-tree.nvim")
local neotree_sources = { buffers = "top", git_status = "right" }
for source, pos in pairs(neotree_sources) do
if vim.list_contains(neotree_opts.sources, source) then
table.insert(opts.left, 3, { table.insert(opts.left, 3, {
title = "Neo-Tree Buffers", title = "Neo-Tree " .. source:gsub("_", " "),
ft = "neo-tree", ft = "neo-tree",
filter = function(buf) filter = function(buf)
return vim.b[buf].neo_tree_source == "buffers" return vim.b[buf].neo_tree_source == source
end, end,
pinned = true, pinned = true,
open = "Neotree position=top buffers", open = "Neotree position=" .. pos .. " " .. source,
}) })
end end
if vim.list_contains(LazyVim.opts("neo-tree").sources, "git_status") then
table.insert(opts.left, 3, {
title = "Neo-Tree Git",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "git_status"
end,
pinned = true,
open = "Neotree position=right git_status",
})
end end
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do for _, pos in ipairs({ "top", "bottom", "left", "right" }) do