fix: export find_file, remove global options, disable follow by default

This commit is contained in:
kiyan42 2020-06-21 12:50:51 +02:00
parent 3bcfc70ea6
commit cf828e0a4b
2 changed files with 3 additions and 8 deletions

View File

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

View File

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