fix(nvim): replace broken is_neotree_open func
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
8c438f692d
commit
eb9ec2ab5a
1 changed files with 6 additions and 4 deletions
|
@ -38,10 +38,12 @@ require('neo-tree').setup({
|
||||||
});
|
});
|
||||||
|
|
||||||
local function is_neotree_open()
|
local function is_neotree_open()
|
||||||
local manager = require('neo-tree.sources.manager');
|
for _, win in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
|
||||||
local renderer = require('neo-tree.ui.renderer');
|
if vim.api.nvim_get_option_value('ft', { buf = vim.api.nvim_win_get_buf(win) }) == 'neo-tree' then
|
||||||
local state = manager.get_state('filesystem');
|
return true;
|
||||||
return renderer.window_exists(state);
|
end;
|
||||||
|
end;
|
||||||
|
return false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
-- Auto open Neo-Tree on big enough window
|
-- Auto open Neo-Tree on big enough window
|
||||||
|
|
Loading…
Reference in a new issue