fixing broken nvimtree (#1012)

This commit is contained in:
Abouzar Parvan 2021-07-18 15:57:06 +04:30 committed by GitHub
parent 5d21a1dbd8
commit 6e6a4a96e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,4 @@
local M = {} local M = {}
local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
if not status_ok then
return
end
-- --
M.config = function() M.config = function()
O.plugin.nvimtree = { O.plugin.nvimtree = {
@ -50,6 +46,10 @@ M.config = function()
end end
-- --
M.setup = function() M.setup = function()
local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
if not status_ok then
return
end
local g = vim.g local g = vim.g
for opt, val in pairs(O.plugin.nvimtree) do for opt, val in pairs(O.plugin.nvimtree) do
@ -65,12 +65,12 @@ M.setup = function()
} }
end end
-- --
local view_status_ok, view = pcall(require, "nvim-tree.view")
if not view_status_ok then
return
end
-- --
M.toggle_tree = function() M.toggle_tree = function()
local view_status_ok, view = pcall(require, "nvim-tree.view")
if not view_status_ok then
return
end
if view.win_open() then if view.win_open() then
require("nvim-tree").close() require("nvim-tree").close()
if package.loaded["bufferline.state"] then if package.loaded["bufferline.state"] then