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:
kiyan42
2020-08-18 19:07:43 +02:00
committed by Kiyan Yazdani
parent 6a0e76edc8
commit 9eea2b8c62
6 changed files with 23 additions and 29 deletions

View File

@@ -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 ''