Add linter plugin support

This commit is contained in:
Zachary Yedidia
2019-08-02 23:46:25 -07:00
parent e7e0272968
commit 4027081e0e
11 changed files with 166 additions and 99 deletions

View File

@@ -80,7 +80,7 @@ func luaImportMicroUtil() *lua.LTable {
ulua.L.SetField(pkg, "RuneAt", luar.New(ulua.L, util.LuaRuneAt))
ulua.L.SetField(pkg, "GetLeadingWhitespace", luar.New(ulua.L, util.LuaGetLeadingWhitespace))
ulua.L.SetField(pkg, "", luar.New(ulua.L, util.LuaIsWordChar))
ulua.L.SetField(pkg, "IsWordChar", luar.New(ulua.L, util.LuaIsWordChar))
return pkg
}

View File

@@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"sort"
@@ -172,7 +173,10 @@ func main() {
screen.TermMessage(err)
}
config.LoadAllPlugins()
err = config.LoadAllPlugins()
if err != nil {
screen.TermMessage(err)
}
err = config.RunPluginFn("init")
if err != nil {
screen.TermMessage(err)
@@ -234,6 +238,7 @@ func main() {
select {
case f := <-shell.Jobs:
// If a new job has finished while running in the background we should execute the callback
log.Println("OUTPUT:", f.Output)
f.Function(f.Output, f.Args...)
case event = <-events:
case <-screen.DrawChan: