Have go plugin create its own options

This commit is contained in:
Zachary Yedidia
2016-04-30 12:13:21 -04:00
parent 05e2886dca
commit 908bcb22ae
4 changed files with 27 additions and 18 deletions

View File

@@ -1,8 +1,15 @@
if GetOption("goimports") == nil then
AddOption("goimports", false)
end
if GetOption("gofmt") == nil then
AddOption("gofmt", true)
end
function go_onSave()
if view.Buf.Filetype == "Go" then
if settings.GoImports then
if GetOption("goimports") then
go_goimports()
elseif settings.GoFmt then
elseif GetOption("gofmt") then
go_gofmt()
end
go_build()