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")
table.insert(opts.left, 3, { local neotree_sources = { buffers = "top", git_status = "right" }
title = "Neo-Tree Buffers",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "buffers"
end,
pinned = true,
open = "Neotree position=top buffers",
})
end
if vim.list_contains(LazyVim.opts("neo-tree").sources, "git_status") then for source, pos in pairs(neotree_sources) do
table.insert(opts.left, 3, { if vim.list_contains(neotree_opts.sources, source) then
title = "Neo-Tree Git", table.insert(opts.left, 3, {
ft = "neo-tree", title = "Neo-Tree " .. source:gsub("_", " "),
filter = function(buf) ft = "neo-tree",
return vim.b[buf].neo_tree_source == "git_status" filter = function(buf)
end, return vim.b[buf].neo_tree_source == source
pinned = true, end,
open = "Neotree position=right git_status", pinned = true,
}) open = "Neotree position=" .. pos .. " " .. source,
})
end
end end
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do for _, pos in ipairs({ "top", "bottom", "left", "right" }) do