refactor: improve API readability and tidy actions submodules (#2593)
* refactor: improve API readability, tidy actions modules * Apply requested changes * `actions/reloaders/reloaders.lua` -> `actions/reloaders.lua` --------- Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -5,7 +5,7 @@ local core = require "nvim-tree.core"
|
||||
local events = require "nvim-tree.events"
|
||||
local notify = require "nvim-tree.notify"
|
||||
local renderer = require "nvim-tree.renderer"
|
||||
local reloaders = require "nvim-tree.actions.reloaders.reloaders"
|
||||
local reloaders = require "nvim-tree.actions.reloaders"
|
||||
|
||||
local HL_POSITION = require("nvim-tree.enum").HL_POSITION
|
||||
|
||||
|
||||
16
lua/nvim-tree/actions/fs/init.lua
Normal file
16
lua/nvim-tree/actions/fs/init.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
local M = {}
|
||||
|
||||
M.copy_paste = require "nvim-tree.actions.fs.copy-paste"
|
||||
M.create_file = require "nvim-tree.actions.fs.create-file"
|
||||
M.remove_file = require "nvim-tree.actions.fs.remove-file"
|
||||
M.rename_file = require "nvim-tree.actions.fs.rename-file"
|
||||
M.trash = require "nvim-tree.actions.fs.trash"
|
||||
|
||||
function M.setup(opts)
|
||||
M.copy_paste.setup(opts)
|
||||
M.remove_file.setup(opts)
|
||||
M.rename_file.setup(opts)
|
||||
M.trash.setup(opts)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -112,7 +112,7 @@ function M.fn(node)
|
||||
local function do_remove()
|
||||
M.remove(node)
|
||||
if not M.config.filesystem_watchers.enable then
|
||||
require("nvim-tree.actions.reloaders.reloaders").reload_explorer()
|
||||
require("nvim-tree.actions.reloaders").reload_explorer()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ function M.fn(default_modifier)
|
||||
|
||||
M.rename(node, prepend .. new_file_path .. append)
|
||||
if not M.config.filesystem_watchers.enable then
|
||||
require("nvim-tree.actions.reloaders.reloaders").reload_explorer()
|
||||
require("nvim-tree.actions.reloaders").reload_explorer()
|
||||
end
|
||||
|
||||
find_file(utils.path_remove_trailing(new_file_path))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
local lib = require "nvim-tree.lib"
|
||||
local notify = require "nvim-tree.notify"
|
||||
local reloaders = require "nvim-tree.actions.reloaders"
|
||||
|
||||
local M = {
|
||||
config = {},
|
||||
@@ -59,7 +60,7 @@ function M.remove(node)
|
||||
end
|
||||
events._dispatch_folder_removed(node.absolute_path)
|
||||
if not M.config.filesystem_watchers.enable then
|
||||
require("nvim-tree.actions.reloaders.reloaders").reload_explorer()
|
||||
reloaders.reload_explorer()
|
||||
end
|
||||
end)
|
||||
else
|
||||
@@ -72,7 +73,7 @@ function M.remove(node)
|
||||
events._dispatch_file_removed(node.absolute_path)
|
||||
clear_buffer(node.absolute_path)
|
||||
if not M.config.filesystem_watchers.enable then
|
||||
require("nvim-tree.actions.reloaders.reloaders").reload_explorer()
|
||||
reloaders.reload_explorer()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user