mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-18 23:07:13 +09:00
@@ -299,6 +299,11 @@ func main() {
|
||||
screen.TermMessage(err)
|
||||
}
|
||||
|
||||
err = config.RunPluginFn("preinit")
|
||||
if err != nil {
|
||||
screen.TermMessage(err)
|
||||
}
|
||||
|
||||
args := flag.Args()
|
||||
b := LoadInput(args)
|
||||
|
||||
@@ -316,6 +321,11 @@ func main() {
|
||||
screen.TermMessage(err)
|
||||
}
|
||||
|
||||
err = config.RunPluginFn("postinit")
|
||||
if err != nil {
|
||||
screen.TermMessage(err)
|
||||
}
|
||||
|
||||
if clipErr != nil {
|
||||
action.InfoBar.Error(clipErr, " or change 'clipboard' option")
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -43,6 +43,12 @@ are called when certain events happen. Here is the list of callbacks
|
||||
which micro defines:
|
||||
|
||||
* `init()`: this function should be used for your plugin initialization.
|
||||
This function is called after buffers have been initialized.
|
||||
|
||||
* `preinit()`: initialization function called before buffers have been
|
||||
initialized.
|
||||
|
||||
* `postinit()`: initialization function called after `init()`.
|
||||
|
||||
* `onBufferOpen(buf)`: runs when a buffer is opened. The input contains
|
||||
the buffer object.
|
||||
|
||||
@@ -59,7 +59,7 @@ function removeLinter(name)
|
||||
linters[name] = nil
|
||||
end
|
||||
|
||||
function init()
|
||||
function preinit()
|
||||
local devnull = "/dev/null"
|
||||
if runtime.GOOS == "windows" then
|
||||
devnull = "NUL"
|
||||
@@ -81,6 +81,7 @@ function init()
|
||||
makeLinter("pyflakes", "python", "pyflakes", {"%f"}, "%f:%l:.-:? %m")
|
||||
makeLinter("mypy", "python", "mypy", {"%f"}, "%f:%l: %m")
|
||||
makeLinter("pylint", "python", "pylint", {"--output-format=parseable", "--reports=no", "%f"}, "%f:%l: %m")
|
||||
makeLinter("flake8", "python", "flake8", {"%f"}, "%f:%l:%c: %m")
|
||||
makeLinter("shfmt", "shell", "shfmt", {"%f"}, "%f:%l:%c: %m")
|
||||
makeLinter("swiftc", "swift", "xcrun", {"swiftc", "%f"}, "%f:%l:%c:.+: %m", {"darwin"}, true)
|
||||
makeLinter("swiftc", "swift", "swiftc", {"%f"}, "%f:%l:%c:.+: %m", {"linux"}, true)
|
||||
@@ -167,7 +168,6 @@ function onExit(output, args)
|
||||
elseif col == nil then
|
||||
hascol = false
|
||||
end
|
||||
micro.Log(basename(buf.Path), basename(file))
|
||||
if basename(buf.Path) == basename(file) then
|
||||
local bmsg = nil
|
||||
if hascol then
|
||||
|
||||
Reference in New Issue
Block a user