summaryrefslogtreecommitdiff
path: root/lua/telescope/_.lua
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2022-03-10 13:48:40 +0100
committerGitHub <noreply@github.com>2022-03-10 13:48:40 +0100
commit234066f875c131b92e99f92495729a8f6f5c1bb9 (patch)
tree31d813f3e642d3eb51fd12c7b4adfce00bb2f942 /lua/telescope/_.lua
parent1daf0917cf859c3c089c62e960b128fe3382fc6d (diff)
fix: man_pages previewer, respecting MANPATH and apropos output parsing (#1764)
- introducing putils writer and use it rather than using PAGER env var - introducing env for lua/telescope/_.lua job interface - to respect MANPATH (and PATH just in case) - fix for apropos output parsing might return e.g. `alacritty, Alacritty` We need to split on first `,`
Diffstat (limited to 'lua/telescope/_.lua')
-rw-r--r--lua/telescope/_.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/lua/telescope/_.lua b/lua/telescope/_.lua
index 6b8b445..eaea824 100644
--- a/lua/telescope/_.lua
+++ b/lua/telescope/_.lua
@@ -299,6 +299,22 @@ M.convert_opts = function(o)
obj.args = args
+ if o.env then
+ if type(o.env) ~= "table" then
+ error(debug.traceback "'env' has to be a table")
+ end
+
+ local transform = {}
+ for k, v in pairs(o.env) do
+ if type(k) == "number" then
+ table.insert(transform, v)
+ elseif type(k) == "string" then
+ table.insert(transform, k .. "=" .. tostring(v))
+ end
+ end
+ obj.env = transform
+ end
+
return command, obj
end