diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2020-09-23 21:18:06 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2020-09-23 21:18:06 +0200 |
commit | 82a800062d424d2eb47a565463a7ef37f63482ae (patch) | |
tree | de1d76de7129ba140fbd502bd0c0e48ea9cc255b | |
parent | 473e2ce3c752d375dcff71e5d93da04986c089a5 (diff) | |
download | vis-par-82a800062d424d2eb47a565463a7ef37f63482ae.tar.gz |
Add option 'autoformat'.
-rw-r--r-- | init.lua | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -14,3 +14,9 @@ vis:operator_new("gq", function(file, range, pos) return range.start -- new cursor location end, "Formating operator, filter range through fmt(1)") +vis:option_register("autoformat", "bool", function(value, toogle) + if not vis.win then return false end + vis.win.autoformat = toogle and not vis.win.autoformat or value + vis:info("Option autoformat = " .. tostring(vis.win.autoformat)) + return true +end, "Automatically format current paragraph.") |