aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2021-02-27 19:41:51 +0100
committerMatěj Cepl <mcepl@cepl.eu>2021-02-27 19:41:51 +0100
commitc88ab421ae0e3b6bab1a3623e5a1a7baa4a29334 (patch)
tree13d9ecc3f56f6187a4156fe6e0f400f8a1b3f597
parent82a800062d424d2eb47a565463a7ef37f63482ae (diff)
downloadvis-par-c88ab421ae0e3b6bab1a3623e5a1a7baa4a29334.tar.gz
Don't make things too complicated.
-rw-r--r--init.lua8
1 files 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