feat: add ability for the tree to change tab
- remove tags file - open/close the tree on `TabEnter` with the option `g:lua_tree_tab_open`
This commit is contained in:
12
lua/tree.lua
12
lua/tree.lua
@@ -24,6 +24,7 @@ end
|
||||
function M.close()
|
||||
if lib.win_open() then
|
||||
lib.close()
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,6 +34,17 @@ function M.open()
|
||||
end
|
||||
end
|
||||
|
||||
local winopts = config.window_options()
|
||||
function M.tab_change()
|
||||
-- we need defer_fn to make sure we close/open after we enter the tab
|
||||
vim.defer_fn(function()
|
||||
if M.close() then
|
||||
M.open()
|
||||
api.nvim_command('wincmd '..winopts.open_command)
|
||||
end
|
||||
end, 1)
|
||||
end
|
||||
|
||||
local function gen_go_to(mode)
|
||||
local icon_state = config.get_icon_state()
|
||||
local flags = mode == 'prev_git_item' and 'b' or ''
|
||||
|
||||
Reference in New Issue
Block a user