mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-08-16 02:45:09 +00:00
feat: Manpages finder (output of apropos) (#134)
First edition. Sometimes weird things can happen with the previewer, but I think I got it 99% working. * feat: Manpages finder (output of apropos) * fixup: Add previewer and fix comments Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
This commit is contained in:
co-authored by
TJ DeVries
parent
2053a2621a
commit
a7957b2bdc
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user