aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2020-07-01 11:53:20 +0200
committerMatěj Cepl <mcepl@cepl.eu>2020-07-01 11:53:20 +0200
commit473e2ce3c752d375dcff71e5d93da04986c089a5 (patch)
treed2e0a25dd920c66f150794c01bdcd6680259239f
parent842236f61a04016d68db42ea662104df9e2914e6 (diff)
downloadvis-par-473e2ce3c752d375dcff71e5d93da04986c089a5.tar.gz
Make program used for formatting configurable
-rw-r--r--init.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index a3cbbc9..8d5582b 100644
--- a/init.lua
+++ b/init.lua
@@ -1,7 +1,9 @@
require('vis')
+par_prg = nil
vis:operator_new("gq", function(file, range, pos)
- local status, out, err = vis:pipe(file, range, "fmt -c -w 65")
+ local prg = (par_prg ~= nil) and par_prg or "fmt -c -w 65"
+ local status, out, err = vis:pipe(file, range, prg)
-- local status, out, err = vis:pipe(file, range, "par -w 65")
if not status then
vis:info(err)