Clean up go plugin

This commit is contained in:
Zachary Yedidia 2016-08-16 13:52:42 -04:00
parent b42aba05a0
commit 563484ffc9
2 changed files with 9 additions and 4 deletions

View file

@ -326,7 +326,7 @@ func runtimePluginsAutocloseAutocloseLua() (*asset, error) {
return a, nil
}
var _runtimePluginsGoGoLua = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xa4\x52\xcd\x6a\xdc\x30\x10\xbe\xeb\x29\x06\x41\x41\x6a\x5d\x3f\x80\xc1\x87\x76\xa1\x7b\x2a\x5b\xda\xd2\x4b\x69\x41\xb5\x46\xb6\xa8\x2c\x19\x69\xdc\x6d\x08\x79\xf7\xe0\x9f\x75\xec\xdd\x4d\x42\xc8\x5c\x0c\xe3\xef\x6f\x3e\xdb\x1a\xd8\x23\x1d\x3a\xb2\xc1\x0b\x5e\x07\xdb\x76\x21\x52\xe2\x12\xca\x12\xbc\x75\x40\x0d\x7a\x06\x00\xf0\x41\xeb\x4b\x58\x06\x46\xb9\x84\x92\xa1\xd7\xec\x5c\xcb\xb4\xf4\x9c\xce\x00\xc9\x80\x62\x3f\x4b\xb0\xcf\xea\x2f\xee\x42\xdb\x2a\xaf\xb7\x3e\xbc\x0e\xf9\x2a\xde\x39\x70\x12\x9a\x40\xa3\x2f\x63\xa6\xf7\xd5\xe0\x03\xc1\x7f\x53\xff\x50\xc8\xd1\xde\x1a\xd8\xf5\xf1\x87\xc5\xa3\x90\xf9\xc7\xde\xe4\x9f\xac\xc3\xef\x37\x1d\x0e\x41\xf9\x3e\xf0\x87\xa4\x33\xfc\x91\x7e\x36\xb0\x61\x96\x97\xb3\xd3\x30\xe8\x12\x5e\xaf\xe5\x0a\xdd\xb4\xb4\xa6\x7a\xcd\x4e\xcf\xb1\x9a\xe5\x9e\x35\xd2\x85\x4a\x39\x68\x94\xd7\x0e\xa1\x04\x1b\xf2\x2e\x74\x78\xf2\x81\xf7\x47\xe0\x90\xe7\x67\x27\x7f\x51\xd4\xac\xe9\x11\x53\xef\x08\xca\x59\xa7\x88\xa8\xb4\xe0\x6f\x15\x9f\x40\xf3\xb6\x72\x21\x0d\x2d\x8e\xbb\x45\xb0\xf8\x8a\x87\xc1\x50\x5e\x84\xdc\xb6\xf1\x44\xd0\x19\xf8\xd2\xb0\xa9\x73\x96\xc4\x45\xe4\x0c\x78\xf1\x9a\xe0\x93\x6c\xa2\x98\x41\xc2\xee\xaa\xf3\xed\xdd\x66\x5b\xe3\x7f\x28\x41\x70\xf1\xf3\xf7\x9b\xf4\xeb\x9d\xe4\xb2\x30\x21\xb6\x8a\xc4\x22\x60\x42\x04\x54\x55\x03\xd6\x43\xa2\x58\xd4\xad\xa2\xaa\x11\x23\x57\x82\x0e\xcb\x57\x27\xf5\xc7\x61\x6e\x7d\xc2\x48\x62\x32\xcc\x46\xa6\x64\xeb\x9f\x22\x22\xf5\xd1\xcf\x89\xc6\x03\xee\x03\x00\x00\xff\xff\xf3\xb7\x03\x04\xc9\x03\x00\x00")
var _runtimePluginsGoGoLua = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xa4\x52\x5d\x8b\xd4\x30\x14\x7d\xef\xaf\x38\x04\x84\x44\xbb\xfd\x01\x85\x3e\xe8\x82\xfb\x24\x2b\xba\xf8\x22\x0a\xb1\xbd\x6d\x83\x69\x52\x92\xdb\x1d\x45\xfc\xef\xd2\x4e\xb6\xd3\xe9\x8c\x8a\x98\x97\x42\x72\xee\xf9\xb8\x3d\xa6\xc5\x1d\xf1\xfd\xc8\xc6\x3b\x29\x3a\x6f\x86\xd1\x07\x8e\x42\xa1\xaa\xe0\x8c\x05\xf7\xe4\x32\x00\x78\xd9\x34\x97\xb0\x1c\xad\xb6\x91\x54\x46\xae\xc9\xf6\x5c\xed\xc0\x7f\xe3\x99\x21\x39\x38\x4c\x89\x22\x7b\xa3\xbf\xd2\xad\x1f\x06\xed\x9a\x73\x1d\xd1\xf9\x22\xea\x47\x12\x6a\x8f\x39\x72\x6c\xde\xb3\x76\x72\xf5\xac\x00\xef\xde\xeb\x47\x92\x6a\x11\x36\x2d\x6e\xa7\xf0\xc1\xd0\x41\xaa\xe2\xd5\xd4\x16\xaf\x8d\xa5\x87\xef\x23\xcd\x16\xc5\x9d\x17\x27\x8f\x09\xfe\x9b\xcd\x9c\xc1\xe6\xb3\x3e\x26\xa5\xf9\x90\x8d\x74\x7d\x21\x57\xc6\xdb\x81\xb7\xa3\xae\xc9\x9e\xbe\xcb\x52\xd6\x3c\x5b\xa4\xf5\xb5\xb6\xe8\xb5\x6b\x2c\xa1\x82\xf1\xc5\xe8\x47\x7a\xd2\xc1\xcd\x01\x02\x45\xb1\x8b\xfc\x56\x73\xbf\x1d\x0f\x14\x27\xcb\xa8\x12\x4f\x19\x48\x37\x52\x3c\xd7\xe2\x08\x4a\xb7\xb5\xf5\x71\xde\xe2\x72\xb7\x12\x96\xef\xe8\x7e\x16\x54\x17\x26\xcf\xb7\xf1\x07\xa3\x09\xf8\xaf\x66\xe3\x68\x0d\xcb\x0b\xcb\x39\x44\xf9\x3f\xc6\xe3\xa9\x2b\x37\x37\x78\xe8\x4d\xc4\xc1\x58\x0b\x0e\xa6\xeb\x28\xa4\x36\x41\xbb\x06\xb5\x9e\x22\x1d\x7f\x07\x7c\x38\x45\x06\x7b\x84\xc9\xed\xf4\x52\x09\x77\x6a\x4b\x88\xc8\x21\x47\xa4\xf1\x6a\xce\x1f\x3f\xcf\x6e\x3b\xfa\x86\x0a\x52\xc8\x8f\x9f\x9f\xc5\x4f\x2f\x94\x50\x65\xeb\xc3\xa0\x59\xae\x04\xad\x0f\x20\x5d\xf7\x30\x0e\x91\x43\xd9\x0d\x9a\xeb\x5e\x2e\xb3\x0a\x8d\x5f\x3b\xc6\xfa\x8b\xa5\xc2\xb8\x48\x81\xe5\x51\x30\x5f\x26\x55\xb6\xad\x60\x20\x9e\x82\x4b\x8e\x96\x00\xbf\x02\x00\x00\xff\xff\x4f\x90\xa7\x78\x31\x04\x00\x00")
func runtimePluginsGoGoLuaBytes() ([]byte, error) {
return bindataRead(
@ -341,7 +341,7 @@ func runtimePluginsGoGoLua() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "runtime/plugins/go/go.lua", size: 969, mode: os.FileMode(420), modTime: time.Unix(1471369533, 0)}
info := bindataFileInfo{name: "runtime/plugins/go/go.lua", size: 1073, mode: os.FileMode(420), modTime: time.Unix(1471369810, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}

View file

@ -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)