refactor: api and command focus call tree.open(), soft deprecate tree.focus()
This commit is contained in:
committed by
gegoune
parent
5e4475d8bf
commit
d5cc938ab0
@@ -13,7 +13,6 @@ local git = require "nvim-tree.git"
|
||||
local filters = require "nvim-tree.explorer.filters"
|
||||
local modified = require "nvim-tree.modified"
|
||||
local find_file = require "nvim-tree.actions.tree.find-file"
|
||||
local open = require "nvim-tree.actions.tree.open"
|
||||
local events = require "nvim-tree.events"
|
||||
local notify = require "nvim-tree.notify"
|
||||
|
||||
@@ -23,11 +22,6 @@ local M = {
|
||||
init_root = "",
|
||||
}
|
||||
|
||||
function M.focus()
|
||||
open.fn()
|
||||
view.focus()
|
||||
end
|
||||
|
||||
--- Update the tree root to a directory or the directory containing
|
||||
--- @param path string relative or absolute
|
||||
--- @param bufnr number|nil
|
||||
|
||||
@@ -86,7 +86,7 @@ Api.tree.close_in_this_tab = wrap(require("nvim-tree.view").close_this_tab_only)
|
||||
Api.tree.close_in_all_tabs = wrap(require("nvim-tree.view").close_all_tabs)
|
||||
|
||||
Api.tree.focus = wrap(function()
|
||||
require("nvim-tree").focus()
|
||||
Api.tree.open()
|
||||
end)
|
||||
|
||||
Api.tree.reload = wrap(require("nvim-tree.actions.reloaders.reloaders").reload_explorer)
|
||||
|
||||
@@ -48,7 +48,7 @@ local CMDS = {
|
||||
bar = true,
|
||||
},
|
||||
command = function()
|
||||
api.tree.focus()
|
||||
api.tree.open()
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user