From c88ab421ae0e3b6bab1a3623e5a1a7baa4a29334 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sat, 27 Feb 2021 19:41:51 +0100 Subject: Don't make things too complicated. --- init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index e2599c7..e7b57ef 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,9 @@ require('vis') -par_prg = nil +par_prg = "fmt -c -w 65" vis:operator_new("gq", function(file, range, pos) - local prg = (par_prg ~= nil) and par_prg or "fmt -c -w 65" - local status, out, err = vis:pipe(file, range, prg) + vis:info("par_prg = " .. par_prg) + local status, out, err = vis:pipe(file, range, par_prg) -- local status, out, err = vis:pipe(file, range, "par -w 65") if not status then vis:info(err) @@ -12,7 +12,7 @@ vis:operator_new("gq", function(file, range, pos) file:insert(range.start, out) end return range.start -- new cursor location -end, "Formating operator, filter range through fmt(1)") +end, "Formating operator, filter range through formatting filter") vis:option_register("autoformat", "bool", function(value, toogle) if not vis.win then return false end -- cgit