summaryrefslogtreecommitdiff
path: root/lua/core/nvimtree.lua
diff options
context:
space:
mode:
authorAbouzar Parvan <[email protected]>2021-07-18 15:57:06 +0430
committerGitHub <[email protected]>2021-07-18 15:57:06 +0430
commit6e6a4a96e07fd5621e9ee0a76bfb907589f89bf6 (patch)
treedf7237a865ae4d3201aec173fb357f9e31e91386 /lua/core/nvimtree.lua
parent5d21a1dbd8e7c4eb8b82f85df75433dcff86d930 (diff)
fixing broken nvimtree (#1012)
Diffstat (limited to 'lua/core/nvimtree.lua')
-rw-r--r--lua/core/nvimtree.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/lua/core/nvimtree.lua b/lua/core/nvimtree.lua
index e3df9afb..7ecbe8c2 100644
--- a/lua/core/nvimtree.lua
+++ b/lua/core/nvimtree.lua
@@ -1,8 +1,4 @@
local M = {}
-local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
-if not status_ok then
- return
-end
--
M.config = function()
O.plugin.nvimtree = {
@@ -50,6 +46,10 @@ M.config = function()
end
--
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
for opt, val in pairs(O.plugin.nvimtree) do
@@ -65,12 +65,12 @@ M.setup = function()
}
end
--
-local view_status_ok, view = pcall(require, "nvim-tree.view")
-if not view_status_ok then
- return
-end
--
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
require("nvim-tree").close()
if package.loaded["bufferline.state"] then