aboutsummaryrefslogtreecommitdiff
path: root/plugins/gofmt.lua
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2022-11-02 08:10:57 +0100
committerGitHub <noreply@github.com>2022-11-02 08:10:57 +0100
commit9bf5649c7df6bbd746956e9a96b616f61a59fa9b (patch)
tree725e2d12dc826f8ebe73807a705371cb4c5af4d9 /plugins/gofmt.lua
parent49139e03398c9d0ecb347267a4882a4eb3f7ee23 (diff)
downloadlite-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.lua14
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,
})