vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit c17f12ef912a3972467f1abcc4dc8cd1d99988c0 parent 5642842f25edec336349c92f14ecc3d5f8e10c15 Author: Florian Fischer <florian.fischer@muhq.space> Date: Sun, 8 Sep 2024 18:45:30 +0200 complete-word: pipe the candidates directly to the command Diffstat:
| M | lua/plugins/complete-word.lua | | | 3 | +-- |
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lua/plugins/complete-word.lua b/lua/plugins/complete-word.lua @@ -24,8 +24,7 @@ vis:map(vis.modes.INSERT, "<C-n>", function() if #candidates == 1 and candidates[1] == "\n" then return end candidates = table.concat(candidates, "\n") - local cmd = "printf '" .. candidates .. "' | sort -u | vis-menu" - local status, out, err = vis:pipe(cmd) + local status, out, err = vis:pipe(candidates, "sort -u | vis-menu") if status ~= 0 or not out then if err then vis:info(err) end return