mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-23 17:27:14 +09:00
Clean up go plugin
This commit is contained in:
@@ -5,8 +5,8 @@ if GetOption("gofmt") == nil then
|
||||
AddOption("gofmt", true)
|
||||
end
|
||||
|
||||
MakeCommand("goimports", "go.goimports")
|
||||
MakeCommand("gofmt", "go.gofmt")
|
||||
MakeCommand("goimports", "go.save")
|
||||
MakeCommand("gofmt", "go.save")
|
||||
|
||||
function onSave()
|
||||
if CurView().Buf.FileType == "Go" then
|
||||
@@ -34,6 +34,11 @@ function goimports()
|
||||
CurView():ReOpen()
|
||||
end
|
||||
|
||||
function save()
|
||||
-- This will trigger onSave and cause gofmt or goimports to run
|
||||
CurView():Save()
|
||||
end
|
||||
|
||||
function split(str, sep)
|
||||
local result = {}
|
||||
local regex = ("([^%s]+)"):format(sep)
|
||||
|
||||
Reference in New Issue
Block a user