From ab75189231d8a787d011fda4d38a1ee90c27c5e6 Mon Sep 17 00:00:00 2001 From: jdhao Date: Fri, 29 Nov 2024 23:24:03 +0100 Subject: [PATCH] Fix command CopyPath issue the string.gsub in lua is not flexible and use vim.fn.substitute() instead. --- plugin/command.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/command.lua b/plugin/command.lua index b8b744cf..560dea15 100644 --- a/plugin/command.lua +++ b/plugin/command.lua @@ -16,7 +16,7 @@ vim.api.nvim_create_user_command("CopyPath", function(context) return end - file_path = string.gsub(full_path, project_root, "") + file_path = vim.fn.substitute(full_path, project_root, "", "g") end if context["args"] == "absolute" then