mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix(egdy): do not add panes for not enabled neo-tree sources
This commit is contained in:
parent
0422dd278a
commit
49b2e98c3f
1 changed files with 26 additions and 18 deletions
|
|
@ -66,24 +66,6 @@ return {
|
|||
size = { height = 0.5 },
|
||||
},
|
||||
{ title = "Neotest Summary", ft = "neotest-summary" },
|
||||
{
|
||||
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",
|
||||
},
|
||||
{
|
||||
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",
|
||||
},
|
||||
{
|
||||
title = "Neo-Tree Other",
|
||||
ft = "neo-tree",
|
||||
|
|
@ -112,6 +94,32 @@ return {
|
|||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- only add neo-tree sources if they are enabled in config
|
||||
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
|
||||
|
||||
if vim.list_contains(LazyVim.opts("neo-tree").sources, "buffers") then
|
||||
table.insert(opts.left, 3, {
|
||||
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
|
||||
|
||||
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do
|
||||
opts[pos] = opts[pos] or {}
|
||||
table.insert(opts[pos], {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue