diff options
Diffstat (limited to 'lua/telescope/make_entry.lua')
| -rw-r--r-- | lua/telescope/make_entry.lua | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 276f149..891d4af 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -403,15 +403,27 @@ function make_entry.gen_from_packages(opts) return function(module_name) local entry = { valid = module_name ~= "", - entry_type = make_entry.types.GENERIC, - value = module_name, ordinal = module_name, - } + } entry.display = make_display(module_name) return entry end end +function make_entry.gen_from_apropos(opts) + opts = opts or {} + + return function(line) + local cmd, _, desc = line:match("^(.*)%s+%((.*)%)%s+%-%s(.*)$") + + return { + value = cmd, + ordinal = cmd, + display = string.format("%-30s : %s", cmd, desc) + } + end +end + return make_entry |
