From 77e2b8ceea048b42773fc454658c17448caa2a93 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Sun, 12 Jun 2022 15:09:41 +0200 Subject: chore: cleanup autocmd builtin (#1947) --- lua/telescope/make_entry.lua | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'lua/telescope/make_entry.lua') diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 940973b..e206fd5 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -1054,26 +1054,24 @@ function make_entry.gen_from_autocommands(_) local make_display = function(entry) return displayer { - { entry.event, "vimAutoEvent" }, - { entry.group, "vimAugroup" }, - { entry.ft_pattern, "vimAutoCmdSfxList" }, - entry.command, + { entry.value.event, "vimAutoEvent" }, + { entry.value.group_name, "vimAugroup" }, + { entry.value.pattern, "vimAutoCmdSfxList" }, + entry.value.command, } end - -- TODO: dump current filtered items to buffer return function(entry) + local group_name = vim.F.if_nil(entry.group_name, "") return { - event = entry.event, - group = entry.group, - ft_pattern = entry.ft_pattern, - command = entry.command, - value = string.format("+%d %s", entry.source_lnum, entry.source_file), - source_file = entry.source_file, - source_lnum = entry.source_lnum, + value = { + event = entry.event, + group_name = group_name, + pattern = entry.pattern, + command = entry.command, + }, -- - valid = true, - ordinal = entry.event .. " " .. entry.group .. " " .. entry.ft_pattern .. " " .. entry.command, + ordinal = entry.event .. " " .. group_name .. " " .. entry.pattern .. " " .. entry.command, display = make_display, } end -- cgit v1.2.3