1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Fix command CopyPath issue

the string.gsub in lua is not flexible and use vim.fn.substitute()
instead.
This commit is contained in:
jdhao 2024-11-29 23:24:03 +01:00
parent 7645751dc1
commit ab75189231

View File

@ -16,7 +16,7 @@ vim.api.nvim_create_user_command("CopyPath", function(context)
return
end
file_path = string.gsub(full_path, project_root, "<project-root>")
file_path = vim.fn.substitute(full_path, project_root, "<project-root>", "g")
end
if context["args"] == "absolute" then