fix: export find_file, remove global options, disable follow by default
This commit is contained in:
parent
3bcfc70ea6
commit
cf828e0a4b
@ -21,12 +21,7 @@ M.Tree = {
|
|||||||
bufnr = nil,
|
bufnr = nil,
|
||||||
winnr = nil,
|
winnr = nil,
|
||||||
buf_options = {
|
buf_options = {
|
||||||
'sidescroll=5',
|
|
||||||
'noswapfile',
|
'noswapfile',
|
||||||
'splitbelow',
|
|
||||||
'noruler',
|
|
||||||
'noshowmode',
|
|
||||||
'noshowcmd'
|
|
||||||
},
|
},
|
||||||
win_options = {
|
win_options = {
|
||||||
relativenumber = false,
|
relativenumber = false,
|
||||||
|
|||||||
@ -89,7 +89,7 @@ local function is_file_readable(fname)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local function find_file()
|
function M.find_file()
|
||||||
local bufname = api.nvim_buf_get_name(api.nvim_get_current_buf())
|
local bufname = api.nvim_buf_get_name(api.nvim_get_current_buf())
|
||||||
if not is_file_readable(bufname) then return end
|
if not is_file_readable(bufname) then return end
|
||||||
|
|
||||||
@ -122,8 +122,8 @@ end
|
|||||||
|
|
||||||
function M.buf_enter()
|
function M.buf_enter()
|
||||||
update_root_dir()
|
update_root_dir()
|
||||||
if vim.g.lua_tree_follow ~= 0 then
|
if vim.g.lua_tree_follow == 1 then
|
||||||
find_file()
|
M.find_file()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user