From bc6385be31359866729d63d759cf0f6b5b4cd814 Mon Sep 17 00:00:00 2001 From: Eugene Oliveros Date: Sat, 8 May 2021 19:38:18 +0800 Subject: feat: Add only_sort_tags option for builtin.tags (#825) --- lua/telescope/make_entry.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lua') 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, -- cgit v1.2.3