Grab helptags from all paths defined in rtp
This commit is contained in:
@@ -486,16 +486,14 @@ end
|
|||||||
builtin.help_tags = function(opts)
|
builtin.help_tags = function(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
local sourced_file = require('plenary.debug_utils').sourced_filepath()
|
|
||||||
local base_directory = vim.fn.fnamemodify(sourced_file, ":h:h:h")
|
|
||||||
local file = base_directory .. "/data/help/tags"
|
|
||||||
|
|
||||||
local tags = {}
|
local tags = {}
|
||||||
local f = assert(io.open(file, "rb"))
|
for _, file in pairs(vim.fn.findfile('doc/tags', vim.o.runtimepath, -1)) do
|
||||||
for line in f:lines() do
|
local f = assert(io.open(file, "rb"))
|
||||||
table.insert(tags, line)
|
for line in f:lines() do
|
||||||
end
|
table.insert(tags, line)
|
||||||
f:close()
|
end
|
||||||
|
f:close()
|
||||||
|
end
|
||||||
|
|
||||||
pickers.new(opts, {
|
pickers.new(opts, {
|
||||||
prompt_title = 'Help',
|
prompt_title = 'Help',
|
||||||
|
|||||||
@@ -365,38 +365,15 @@ function make_entry.gen_from_treesitter(opts)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function make_entry.gen_from_tagfile(opts)
|
function make_entry.gen_from_tagfile(_)
|
||||||
local help_entry, version
|
local delim = string.char(9)
|
||||||
local delim = string.char(7)
|
|
||||||
|
|
||||||
local make_display = function(line)
|
local make_display = function(line)
|
||||||
help_entry = ""
|
local help_entry = (line..delim):match("(.-)" .. delim)
|
||||||
display = ""
|
return {
|
||||||
version = ""
|
display = help_entry,
|
||||||
|
value = help_entry
|
||||||
line = line .. delim
|
}
|
||||||
for section in line:gmatch("(.-)" .. delim) do
|
|
||||||
if section:find("^vim:") == nil then
|
|
||||||
local ver = section:match("^neovim:(.*)")
|
|
||||||
if ver == nil then
|
|
||||||
help_entry = section
|
|
||||||
else
|
|
||||||
version = ver:sub(1, -2)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
result = {}
|
|
||||||
if version ~= "" then -- some Vim only entries are unversioned
|
|
||||||
if opts.show_version then
|
|
||||||
result.display = string.format("%s [%s]", help_entry, version)
|
|
||||||
else
|
|
||||||
result.display = help_entry
|
|
||||||
end
|
|
||||||
result.value = help_entry
|
|
||||||
end
|
|
||||||
|
|
||||||
return result
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return function(line)
|
return function(line)
|
||||||
|
|||||||
Reference in New Issue
Block a user