From 234066f875c131b92e99f92495729a8f6f5c1bb9 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Thu, 10 Mar 2022 13:48:40 +0100 Subject: 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 `,` --- lua/telescope/make_entry.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lua/telescope/make_entry.lua') diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 38a5d9b..9881097 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -611,6 +611,11 @@ function make_entry.gen_from_apropos(opts) return function(line) local keyword, cmd, section, desc = line:match "^((.-)%s*%(([^)]+)%).-)%s+%-%s+(.*)$" + -- apropos might return alternatives for the cmd which are split on `,` and breaks everything else + -- for example on void linux it will return `alacritty, Alacritty` which will later result in + -- `man 1 alacritty, Alacritty`. So we just take the first one. + -- doing this outside of regex because of obvious reasons + cmd = vim.split(cmd, ",")[1] return keyword and sections[section] and { -- cgit v1.2.3