|
|
@ -13,8 +13,17 @@ local actions = require "fzf-lua.actions"
|
|
|
|
local M = {}
|
|
|
|
local M = {}
|
|
|
|
|
|
|
|
|
|
|
|
local function getmanpage(line)
|
|
|
|
local function getmanpage(line)
|
|
|
|
-- match until comma or space
|
|
|
|
-- extract section from the last pair of parentheses
|
|
|
|
return string.match(line, "[^, ]+")
|
|
|
|
local name, section = line:match("^(.*)%((.-)%)[^()]-$")
|
|
|
|
|
|
|
|
if name:sub(-1) == " " then
|
|
|
|
|
|
|
|
-- man-db
|
|
|
|
|
|
|
|
name = name:sub(1, -2)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
-- mandoc
|
|
|
|
|
|
|
|
name = name:match("^[^, ]+")
|
|
|
|
|
|
|
|
section = section:match("^[^, ]+")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return name .. "(" .. section .. ")"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
M.manpages = function(opts)
|
|
|
|
M.manpages = function(opts)
|
|
|
|