Skip to content

Commit 62906f0

Browse files
authored
fix: collapse exit early if nvim-tree not loaded (#1128)
1 parent 51d1af4 commit 62906f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/nvim-tree/actions/collapse-all.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ local core = require "nvim-tree.core"
55
local M = {}
66

77
function M.fn(keep_buffers)
8+
if not core.get_explorer() then
9+
return
10+
end
11+
812
local buffer_paths = {}
913
for _, buffer in ipairs(vim.api.nvim_list_bufs()) do
1014
table.insert(buffer_paths, vim.api.nvim_buf_get_name(buffer))

0 commit comments

Comments
 (0)