Skip to content

Commit e81742f

Browse files
committed
Fix api.close calls
1 parent 86e98ef commit e81742f

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

lua/nvim-tree.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ function M.setup(conf)
768768
require("nvim-tree.watcher").purge_watchers()
769769

770770
if not M.setup_called then
771-
setup_vim_commands(opts)
771+
setup_vim_commands()
772772
end
773773

774774
if M.setup_called and view.is_visible() then

lua/nvim-tree/actions/dispatch.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
local api = vim.api
2-
31
local view = require "nvim-tree.view"
42
local lib = require "nvim-tree.lib"
53

64
local M = {}
75

86
local Actions = {
9-
close = api.close,
7+
close = view.close,
108

119
-- Tree modifiers
1210
collapse_all = require("nvim-tree.actions.tree-modifiers.collapse-all").fn,

lua/nvim-tree/actions/node/open-file.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ end
132132

133133
local function open_file_in_tab(filename)
134134
if M.quit_on_open then
135-
api.close()
135+
view.close(false)
136136
end
137137
vim.cmd("tabe " .. vim.fn.fnameescape(filename))
138138
end
@@ -299,7 +299,7 @@ function M.fn(mode, filename)
299299
end
300300

301301
if M.quit_on_open then
302-
api.close()
302+
view.close(false)
303303
end
304304
end
305305

lua/nvim-tree/lib.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function M.open(cwd)
117117
core.init(cwd or vim.loop.cwd())
118118
end
119119
if should_hijack_current_buf() then
120-
api.close()
120+
view.close(false)
121121
view.open_in_current_win()
122122
renderer.draw()
123123
else

lua/nvim-tree/live-filter.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ local function remove_overlay()
3131
group = vim.api.nvim_create_augroup("NvimTree", { clear = false }),
3232
callback = function()
3333
if utils.is_nvim_tree_buf(0) then
34-
a.close()
34+
view.close(false)
3535
end
3636
end,
3737
})

lua/nvim-tree/view.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ local function matches_bufnr(bufnr)
7575
end
7676

7777
local function wipe_rogue_buffer()
78-
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do if not matches_bufnr(bufnr) and utils.is_nvim_tree_buf(bufnr) then
78+
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
79+
if not matches_bufnr(bufnr) and utils.is_nvim_tree_buf(bufnr) then
7980
pcall(vim.api.nvim_buf_delete, bufnr, { force = true })
8081
end
8182
end

0 commit comments

Comments
 (0)