mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-24 09:47:19 +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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user