Commit: 77efdbaf7e744384ac04e2447afed1bb11234edb
Parent: 146caf0baaee4aca5712b323698079082fed5670
Author: Randy Palamar
Date: Thu, 5 Jan 2023 09:12:57 -0700
vis: gpg: strip white space in info and use string methods
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/.config/vis/gpg.lua b/.config/vis/gpg.lua
@@ -9,11 +9,11 @@ local function decrypt(file)
local err, ostr, estr = vis:pipe(file, {start = 0, finish = file.size}, "gpg -d")
if err ~= 0 then return false end
- local i = string.find(estr, "ID")
- local j = string.find(estr, ",", i)
- local keyid = string.sub(estr, i+3, j-1)
+ local i = estr:find("ID")
+ local j = estr:find(",", i)
+ local keyid = estr:sub(i+3, j-1)
if keyid ~= gpg.key then
- vis:info(estr)
+ vis:info(estr:gsub("\n[ ]*", " "))
gpg.key = keyid
end