* fix(#2395): marks.bulk.move defaults to directory at cursor * fix(#2395): adds check if node_at_cursor.parent is nil --------- Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -3,6 +3,7 @@ local core = require "nvim-tree.core"
|
|||||||
local utils = require "nvim-tree.utils"
|
local utils = require "nvim-tree.utils"
|
||||||
local rename_file = require "nvim-tree.actions.fs.rename-file"
|
local rename_file = require "nvim-tree.actions.fs.rename-file"
|
||||||
local notify = require "nvim-tree.notify"
|
local notify = require "nvim-tree.notify"
|
||||||
|
local lib = require "nvim-tree.lib"
|
||||||
|
|
||||||
local M = {
|
local M = {
|
||||||
config = {},
|
config = {},
|
||||||
@@ -14,9 +15,18 @@ function M.bulk_move()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local node_at_cursor = lib.get_node_at_cursor()
|
||||||
|
local default_path = core.get_cwd()
|
||||||
|
|
||||||
|
if node_at_cursor and node_at_cursor.type == "directory" then
|
||||||
|
default_path = node_at_cursor.absolute_path
|
||||||
|
elseif node_at_cursor and node_at_cursor.parent then
|
||||||
|
default_path = node_at_cursor.parent.absolute_path
|
||||||
|
end
|
||||||
|
|
||||||
local input_opts = {
|
local input_opts = {
|
||||||
prompt = "Move to: ",
|
prompt = "Move to: ",
|
||||||
default = core.get_cwd(),
|
default = default_path,
|
||||||
completion = "dir",
|
completion = "dir",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user