summaryrefslogtreecommitdiff
path: root/lua/telescope
diff options
context:
space:
mode:
authorDane Summers <dsummersl@yahoo.com>2022-06-13 12:42:00 -0400
committerSimon Hauser <simon.hauser@helsinki-systems.de>2022-06-30 14:01:51 +0200
commitdb4635bddf4a4f48c9edce80ce5157275e6bba34 (patch)
treede68490449f04c87734fd42806d9d3cfefed5b17 /lua/telescope
parent3a72cc89024120d09f32d70689cc9cbe367fc2b4 (diff)
fix(current_buffer_tags): tag-relative=never (#1970)
Diffstat (limited to 'lua/telescope')
-rw-r--r--lua/telescope/make_entry.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index e206fd5..efeb750 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -935,6 +935,7 @@ function make_entry.gen_from_ctags(opts)
end
end
+ local current_file_cache = {}
return function(line)
if line == "" or line:sub(1, 1) == "!" then
return nil
@@ -952,8 +953,14 @@ function make_entry.gen_from_ctags(opts)
file = string.gsub(file, "/", "\\")
end
- if opts.only_current_file and file ~= current_file then
- return nil
+ 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
+ end
end
local tag_entry = {}