call the on_enter function in open and toggle function

This commit is contained in:
Raphael 2020-10-21 20:06:53 +08:00 committed by GitHub
parent 87a4d60bbc
commit 8e3debfb5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,10 +9,11 @@ local api = vim.api
local M = {}
function M.toggle()
function M.toggle()
if lib.win_open() then
lib.close()
else
M.on_enter()
if vim.g.lua_tree_follow == 1 then
M.find_file(true)
else
@ -30,6 +31,7 @@ end
function M.open()
if not lib.win_open() then
M.on_enter()
lib.open()
end
end