Skip to content

Commit

Permalink
Fix command CopyPath issue
Browse files Browse the repository at this point in the history
the string.gsub in lua is not flexible and use vim.fn.substitute()
instead.
  • Loading branch information
jdhao committed Nov 29, 2024
1 parent 7645751 commit ab75189
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/command.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab75189

Please sign in to comment.