summaryrefslogtreecommitdiff
path: root/lua/telescope/make_entry.lua
diff options
context:
space:
mode:
authorEugene Oliveros <eevoliveros@gmail.com>2021-05-08 19:38:18 +0800
committerGitHub <noreply@github.com>2021-05-08 13:38:18 +0200
commitbc6385be31359866729d63d759cf0f6b5b4cd814 (patch)
tree346e827c27349feb7d9857f7d57756d65cd3915b /lua/telescope/make_entry.lua
parent88f7b27222ac75223ab971c5158dbcf64a326669 (diff)
feat: Add only_sort_tags option for builtin.tags (#825)
Diffstat (limited to 'lua/telescope/make_entry.lua')
-rw-r--r--lua/telescope/make_entry.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index 8729ebb..80e9daa 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -834,6 +834,8 @@ function make_entry.gen_from_vimoptions()
end
end
+--- Special options:
+--- - only_sort_tags: Only sort via tag name. Ignore filename and other items
function make_entry.gen_from_ctags(opts)
opts = opts or {}
@@ -893,10 +895,17 @@ function make_entry.gen_from_ctags(opts)
return nil
end
+ local ordinal
+
+ if opts.only_sort_tags then
+ ordinal = tag
+ else
+ ordinal = file .. ': ' .. tag
+ end
+
return {
valid = true,
-
- ordinal = file .. ': ' .. tag,
+ ordinal = ordinal,
display = make_display,
scode = scode,
tag = tag,