Update plugins for local settings

This commit is contained in:
Zachary Yedidia
2016-08-25 16:01:42 -04:00
parent 1a9123630b
commit ec0833b09c
6 changed files with 130 additions and 121 deletions

View File

@@ -5,15 +5,18 @@ if GetOption("gofmt") == nil then
AddOption("gofmt", true)
end
if CurView().Buf.FileType == "go" then
SetOption("tabstospaces", "off")
end
MakeCommand("goimports", "go.goimports", 0)
MakeCommand("gofmt", "go.gofmt", 0)
function onViewOpen(view)
-- messenger:Message("HI")
if view.Buf:FileType() == "go" then
SetLocalOption("tabstospaces", "off", view)
end
end
function onSave()
if CurView().Buf.FileType == "go" then
if CurView().Buf:FileType() == "go" then
if GetOption("goimports") then
goimports()
elseif GetOption("gofmt") then

View File

@@ -6,7 +6,7 @@ MakeCommand("lint", "linter.runLinter", 0)
function runLinter()
CurView():Save(false)
local ft = CurView().Buf.FileType
local ft = CurView().Buf:FileType()
local file = CurView().Buf.Path
local devnull = "/dev/null"
if OS == "windows" then