Revert "feat: reset old window when leaving the tree" (#421)
This commit is contained in:
@@ -194,20 +194,6 @@ function M.reset_highlight()
|
||||
renderer.render_hl(view.View.bufnr)
|
||||
end
|
||||
|
||||
local old_win = nil
|
||||
|
||||
function M.save_previous_buf()
|
||||
vim.cmd "wincmd p"
|
||||
old_win = api.nvim_get_current_win()
|
||||
vim.cmd "wincmd p"
|
||||
end
|
||||
|
||||
function M.set_previous_buf()
|
||||
if old_win then
|
||||
api.nvim_set_current_win(old_win)
|
||||
end
|
||||
end
|
||||
|
||||
view.setup()
|
||||
colors.setup()
|
||||
vim.defer_fn(M.on_enter, 1)
|
||||
|
||||
@@ -17,8 +17,6 @@ augroup NvimTree
|
||||
au User LspDiagnosticsChanged lua require'nvim-tree.diagnostics'.update()
|
||||
endif
|
||||
au BufEnter * lua require'nvim-tree'.buf_enter()
|
||||
au BufEnter NvimTree lua require'nvim-tree'.save_previous_buf()
|
||||
au BufLeave NvimTree lua require'nvim-tree'.set_previous_buf()
|
||||
if get(g:, 'nvim_tree_auto_close') == 1
|
||||
au WinClosed * lua require'nvim-tree'.on_leave()
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user