mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 22:27:13 +09:00
Update plugins for local settings
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user