fix(#2086): "Rename: Omit Filename" not removing file name (#2087)

This commit is contained in:
Pholawat
2023-03-27 06:52:09 +07:00
committed by GitHub
parent 6319ad9405
commit a38f9a55a4
2 changed files with 5 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ local notify = require "nvim-tree.notify"
local M = {}
local ALLOWED_MODIFIERS = {
[":p"] = true,
[":p:h"] = true,
[":t"] = true,
[":t:r"] = true,
}
@@ -68,6 +68,9 @@ function M.fn(default_modifier)
local extension = vim.fn.fnamemodify(node.name, ":e")
append = extension:len() == 0 and "" or "." .. extension
end
if modifier == ":p:h" then
default_path = default_path .. "/"
end
local input_opts = { prompt = "Rename to ", default = default_path, completion = "file" }