From 48820cb1a0ba7213c08748f8c2bd04e4d0a7ed62 Mon Sep 17 00:00:00 2001 From: Nolan Prochnau Date: Mon, 9 Nov 2020 22:05:02 -0500 Subject: Grab helptags from all paths defined in rtp --- lua/telescope/builtin.lua | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'lua/telescope/builtin.lua') diff --git a/lua/telescope/builtin.lua b/lua/telescope/builtin.lua index d4030ae..a84a46b 100644 --- a/lua/telescope/builtin.lua +++ b/lua/telescope/builtin.lua @@ -486,16 +486,14 @@ end builtin.help_tags = function(opts) 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 f = assert(io.open(file, "rb")) - for line in f:lines() do - table.insert(tags, line) - end - f:close() + for _, file in pairs(vim.fn.findfile('doc/tags', vim.o.runtimepath, -1)) do + local f = assert(io.open(file, "rb")) + for line in f:lines() do + table.insert(tags, line) + end + f:close() + end pickers.new(opts, { prompt_title = 'Help', -- cgit v1.2.3 From 1678d7cb131175a1e4c3a2507b41c19b83a35a80 Mon Sep 17 00:00:00 2001 From: Nolan Prochnau Date: Mon, 9 Nov 2020 22:18:36 -0500 Subject: Rename and simplify make_entry function --- lua/telescope/builtin.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/telescope/builtin.lua') 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), -- cgit v1.2.3