diff options
| author | Nolan Prochnau <parvus.mortalis@gmail.com> | 2020-11-09 22:18:36 -0500 |
|---|---|---|
| committer | Nolan Prochnau <parvus.mortalis@gmail.com> | 2020-11-09 22:18:36 -0500 |
| commit | 1678d7cb131175a1e4c3a2507b41c19b83a35a80 (patch) | |
| tree | 18280be3a62b2934ca31665158e2f8952d1f1e69 /lua | |
| parent | 6667fd36b1a1bae6bf96bc809285e320c615658d (diff) | |
Rename and simplify make_entry function
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/builtin.lua | 2 | ||||
| -rw-r--r-- | lua/telescope/make_entry.lua | 20 |
2 files changed, 7 insertions, 15 deletions
diff --git a/lua/telescope/builtin.lua b/lua/telescope/builtin.lua index a84a46b..e1857e6 100644 --- a/lua/telescope/builtin.lua +++ b/lua/telescope/builtin.lua @@ -499,7 +499,7 @@ builtin.help_tags = function(opts) prompt_title = 'Help', finder = finders.new_table { results = tags, - entry_maker = make_entry.gen_from_tagfile(opts), + entry_maker = make_entry.gen_from_taglist(opts), }, -- TODO: previewer for Vim help previewer = previewers.help.new(opts), diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index c19acde..5e7d493 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -365,24 +365,16 @@ function make_entry.gen_from_treesitter(opts) end end -function make_entry.gen_from_tagfile(_) +function make_entry.gen_from_taglist(_) local delim = string.char(9) - local make_display = function(line) - local help_entry = (line..delim):match("(.-)" .. delim) - return { - display = help_entry, - value = help_entry - } - end - return function(line) local entry = {} - local d = make_display(line) - entry.valid = next(d) ~= nil - entry.display = d.display - entry.value = d.value - entry.ordinal = d.value + local tag = (line..delim):match("(.-)" .. delim) + entry.valid = tag ~= "" + entry.display = tag + entry.value = tag + entry.ordinal = tag return entry end |
