From c569e85f6a1521b30437335b247732f6af635a61 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 8 Sep 2024 18:45:30 +0200 Subject: complete-word: pipe the candidates directly to the command --- lua/plugins/complete-word.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lua/plugins') diff --git a/lua/plugins/complete-word.lua b/lua/plugins/complete-word.lua index 5e355e8..511b47e 100644 --- a/lua/plugins/complete-word.lua +++ b/lua/plugins/complete-word.lua @@ -24,8 +24,7 @@ vis:map(vis.modes.INSERT, "", 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 -- cgit v1.2.3