fix(current_buffer_tags): tag-relative=never (#1970)

This commit is contained in:
Dane Summers
2022-06-13 12:42:00 -04:00
committed by Simon Hauser
parent 3a72cc8902
commit db4635bddf

View File

@@ -935,6 +935,7 @@ function make_entry.gen_from_ctags(opts)
end end
end end
local current_file_cache = {}
return function(line) return function(line)
if line == "" or line:sub(1, 1) == "!" then if line == "" or line:sub(1, 1) == "!" then
return nil return nil
@@ -952,9 +953,15 @@ function make_entry.gen_from_ctags(opts)
file = string.gsub(file, "/", "\\") file = string.gsub(file, "/", "\\")
end end
if opts.only_current_file and file ~= current_file then if opts.only_current_file then
if current_file_cache[file] == nil then
current_file_cache[file] = Path:new(file):normalize(cwd) == current_file
end
if current_file_cache[file] == false then
return nil return nil
end end
end
local tag_entry = {} local tag_entry = {}
if opts.only_sort_tags then if opts.only_sort_tags then