add % before special char to string match

This commit is contained in:
ray-x 2021-09-14 15:03:29 +10:00
parent 8dd865be82
commit d6c4cf570a

View File

@ -7,8 +7,8 @@ function M.switch(bang, cmd)
print("no buffer name")
return
end
local s, e = string.find(file, "_test.go$")
local s2, e2 = string.find(file, ".go$")
local s, e = string.find(file, "_test%.go$")
local s2, e2 = string.find(file, "%.go$")
if s ~= nil then
root = vim.fn.split(file, '_test.go')[1]
alt_file = root .. '.go'