From b8117bb9ec7b80028df8ff4deca48272a0501359 Mon Sep 17 00:00:00 2001 From: Georgi Kirilov <> Date: Sun, 20 Dec 2020 20:51:07 +0200 Subject: Fix arrows in vis-menu by using vis:pipe() --- spellcheck.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spellcheck.lua b/spellcheck.lua index 90ba907..d6483df 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -348,12 +348,10 @@ vis:map(vis.modes.NORMAL, "w", function(keys) -- select a correction local cmd = 'printf "' .. suggestions:gsub(", ", "\\n") .. '\\n" | vis-menu' - local f = assert(io.popen(cmd)) - local correction = f:read("*all") - f:close() - -- trim correction - correction = correction:match("^%s*(.-)%s*$") - if correction ~= "" then + local status, correction = vis:pipe(file, {start = 0, finish = 0}, cmd) + if status == 0 then + -- trim correction + correction = correction:match("^%s*(.-)%s*$") win.file:delete(range) win.file:insert(range.start, correction) end -- cgit