Skip to content

Commit e13ac90

Browse files
committed
fix(#2395): marks.bulk.move defaults to directory at cursor
1 parent d52fdeb commit e13ac90

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lua/nvim-tree/marks/bulk-move.lua

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ local core = require "nvim-tree.core"
33
local utils = require "nvim-tree.utils"
44
local rename_file = require "nvim-tree.actions.fs.rename-file"
55
local notify = require "nvim-tree.notify"
6+
local lib = require "nvim-tree.lib"
67

78
local M = {
89
config = {},
@@ -14,9 +15,18 @@ function M.bulk_move()
1415
return
1516
end
1617

18+
local node_at_cursor = lib.get_node_at_cursor()
19+
local default_path = core.get_cwd()
20+
21+
if node_at_cursor and node_at_cursor.type ~= "directory" then
22+
default_path = node_at_cursor.parent.absolute_path
23+
elseif node_at_cursor then
24+
default_path = node_at_cursor.absolute_path
25+
end
26+
1727
local input_opts = {
1828
prompt = "Move to: ",
19-
default = core.get_cwd(),
29+
default = default_path,
2030
completion = "dir",
2131
}
2232

0 commit comments

Comments
 (0)