diff options
| author | Luke Kershaw <35707277+l-kershaw@users.noreply.github.com> | 2021-12-19 17:55:50 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-19 17:55:50 +0000 |
| commit | 9aaaa0c5f3eb665b51bbcafda084de4b0952fef0 (patch) | |
| tree | b80cdb4a8b01d5afe5678218ea280fb4d275678d /lua/telescope/builtin/internal.lua | |
| parent | 5f37fbfa837dfee7ecd30f388b271f4a71c0a9e0 (diff) | |
fix: `builtin` only have entries for extension functions (#1587)
* fix: `builtin` only have entries for extension functions
* fix: add check for underscore and explanation of which functions included
Diffstat (limited to 'lua/telescope/builtin/internal.lua')
| -rw-r--r-- | lua/telescope/builtin/internal.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lua/telescope/builtin/internal.lua b/lua/telescope/builtin/internal.lua index a868bc6..7892ba4 100644 --- a/lua/telescope/builtin/internal.lua +++ b/lua/telescope/builtin/internal.lua @@ -55,11 +55,14 @@ internal.builtin = function(opts) title = "Telescope Pickers" for ext, funcs in pairs(require("telescope").extensions) do for func_name, func_obj in pairs(funcs) do - local debug_info = debug.getinfo(func_obj) - table.insert(objs, { - filename = string.sub(debug_info.source, 2), - text = string.format("%s : %s", ext, func_name), - }) + -- Only include exported functions whose name doesn't begin with an underscore + if type(func_obj) == "function" and string.sub(func_name, 0, 1) ~= "_" then + local debug_info = debug.getinfo(func_obj) + table.insert(objs, { + filename = string.sub(debug_info.source, 2), + text = string.format("%s : %s", ext, func_name), + }) + end end end end |
