chore: add guards to prepare setup refactoring

This commit is contained in:
kiyan
2022-02-11 11:06:11 +01:00
parent 0708a1c551
commit 0f7da146bf
5 changed files with 10 additions and 4 deletions

View File

@@ -183,6 +183,8 @@ local function update_base_dir_with_filepath(filepath, bufnr)
end
function M.find_file(with_open)
if not with_open and not TreeExplorer then return end
local bufname = vim.fn.bufname()
local bufnr = api.nvim_get_current_buf()
local filepath = vim.fn.fnamemodify(bufname, ':p')
@@ -224,6 +226,7 @@ function M.on_leave()
end, 50)
end
-- TODO: rewrite this to take into account setup by open
function M.open_on_directory()
local should_proceed = _config.update_to_buf_dir.auto_open or view.win_open()
if not _config.update_to_buf_dir.enable or not should_proceed then