fix(tags): wrong path separator on Windows (#1354)

the universal-ctags generates tag file in Unix path separator
even on Windows platform, this PR fix this.
This commit is contained in:
x1314aq
2021-10-19 23:59:54 +08:00
committed by GitHub
parent b5c63c6329
commit 9cad3a4a5d

View File

@@ -909,6 +909,10 @@ function make_entry.gen_from_ctags(opts)
tag, file, lnum = string.match(line, "([^\t]+)\t([^\t]+)\t(%d+).*") tag, file, lnum = string.match(line, "([^\t]+)\t([^\t]+)\t(%d+).*")
end end
if Path.path.sep == "\\" then
file = string.gsub(file, "/", "\\")
end
if opts.only_current_file and file ~= current_file then if opts.only_current_file and file ~= current_file then
return nil return nil
end end