Skip to content

Commit 0ce8c25

Browse files
committed
Update
1 parent 793a0f0 commit 0ce8c25

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

go.lua

+7-8
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ local shell = import("micro/shell")
66
local buffer = import("micro/buffer")
77

88
function init()
9-
config.RegisterCommonOption("goimports", false)
10-
config.RegisterCommonOption("gofmt", true)
9+
config.RegisterCommonOption("go", "goimports", false)
10+
config.RegisterCommonOption("go", "gofmt", true)
1111

12-
config.MakeCommand("goimports", "go.goimports", config.NoComplete)
13-
config.MakeCommand("gofmt", "go.gofmt", config.NoComplete)
14-
config.MakeCommand("gorename", "go.gorename", config.NoComplete)
12+
config.MakeCommand("goimports", goimports, config.NoComplete)
13+
config.MakeCommand("gofmt", gofmt, config.NoComplete)
14+
config.MakeCommand("gorename", gorenameCmd, config.NoComplete)
1515

1616
config.AddRuntimeFile("go", config.RTHelp, "help/go-plugin.md")
1717
config.TryBindKey("F6", "command-edit:gorename ", false)
18-
config.MakeCommand("gorename", "go.gorenameCmd", config.NoComplete)
1918
end
2019

2120
function onSave(bp)
@@ -52,10 +51,10 @@ function gorenameCmd(bp, args)
5251
local loc = buffer.Loc(c.X, c.Y)
5352
local offset = buffer.ByteOffset(loc, buf)
5453
local cmdargs = {"--offset", buf.Path .. ":#" .. tostring(offset), "--to", args[1]}
55-
shell.JobSpawn("gorename", cmdargs, "", "go.renameStderr", "go.renameExit", bp)
54+
shell.JobSpawn("gorename", cmdargs, nil, renameStderr, renameExit, bp)
5655
else
5756
local cmdargs = {"--from", args[1], "--to", args[2]}
58-
shell.JobSpawn("gorename", cmdargs, "", "go.renameStderr", "go.renameExit", bp)
57+
shell.JobSpawn("gorename", cmdargs, nil, renameStderr, renameExit, bp)
5958
end
6059
micro.InfoBar():Message("Renaming...")
6160
end

repo.json

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
"Tags": ["go", "golang"],
55
"Website": "https://github.com/micro-editor/go-plugin",
66
"Versions": [
7+
{
8+
"Version": "2.0.1",
9+
"Url": "https://github.com/micro-editor/go-plugin/archive/v2.0.1.zip",
10+
"Require": {
11+
"micro": ">=2.0.0-1"
12+
}
13+
},
714
{
815
"Version": "2.0.0",
916
"Url": "https://github.com/micro-editor/go-plugin/archive/v2.0.0.zip",

0 commit comments

Comments
 (0)