diff options
author | Guldoman <giulio.lettieri@gmail.com> | 2022-11-02 08:10:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-02 08:10:57 +0100 |
commit | 9bf5649c7df6bbd746956e9a96b616f61a59fa9b (patch) | |
tree | 725e2d12dc826f8ebe73807a705371cb4c5af4d9 /plugins/gofmt.lua | |
parent | 49139e03398c9d0ecb347267a4882a4eb3f7ee23 (diff) | |
download | lite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.tar.gz lite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.zip |
Use new `command.add` syntax (#136)
Diffstat (limited to 'plugins/gofmt.lua')
-rw-r--r-- | plugins/gofmt.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/gofmt.lua b/plugins/gofmt.lua index fec95e4..a8e3576 100644 --- a/plugins/gofmt.lua +++ b/plugins/gofmt.lua @@ -29,17 +29,17 @@ local function update_doc(cmd, doc) doc:set_selection(table.unpack(sel)) end -command.add("core.docview", { - ["gofmt:gofmt"] = function() - update_doc("gofmt", core.active_view.doc) +command.add("core.docview!", { + ["gofmt:gofmt"] = function(dv) + update_doc("gofmt", dv.doc) end, - ["gofmt:goimports"] = function() - update_doc("goimports", core.active_view.doc) + ["gofmt:goimports"] = function(dv) + update_doc("goimports", dv.doc) end, - ["gofmt:goreturns"] = function() - update_doc("goreturns", core.active_view.doc) + ["gofmt:goreturns"] = function(dv) + update_doc("goreturns", dv.doc) end, }) |