diff --git a/cmd/micro/job.go b/cmd/micro/job.go new file mode 100644 index 00000000..1486706c --- /dev/null +++ b/cmd/micro/job.go @@ -0,0 +1,67 @@ +package main + +import ( + "bytes" + "io" + "os/exec" + "strings" +) + +type JobFunction struct { + function func(string, ...string) + output string + args []string +} + +type CallbackFile struct { + io.Writer + + callback func(string, ...string) + args []string +} + +func (f *CallbackFile) Write(data []byte) (int, error) { + jobFunc := JobFunction{f.callback, string(data), f.args} + jobs <- jobFunc + return f.Writer.Write(data) +} + +func JobStart(cmd string, onStdout, onStderr, onExit string, userargs ...string) *exec.Cmd { + split := strings.Split(cmd, " ") + args := split[1:] + cmdName := split[0] + + proc := exec.Command(cmdName, args...) + var outbuf bytes.Buffer + if onStdout != "" { + proc.Stdout = &CallbackFile{&outbuf, LuaFunctionJob(onStdout), userargs} + } else { + proc.Stdout = &outbuf + } + if onStderr != "" { + proc.Stderr = &CallbackFile{&outbuf, LuaFunctionJob(onStderr), userargs} + } else { + proc.Stderr = &outbuf + } + + go func() { + proc.Run() + jobFunc := JobFunction{LuaFunctionJob(onExit), string(outbuf.Bytes()), userargs} + jobs <- jobFunc + }() + + return proc +} + +func JobStop(cmd *exec.Cmd) { + cmd.Process.Kill() +} + +func JobSend(cmd *exec.Cmd, data string) { + stdin, err := cmd.StdinPipe() + if err != nil { + return + } + + stdin.Write([]byte(data)) +} diff --git a/cmd/micro/messenger.go b/cmd/micro/messenger.go index 620c27bd..1542c1c8 100644 --- a/cmd/micro/messenger.go +++ b/cmd/micro/messenger.go @@ -106,7 +106,7 @@ func (m *Messenger) YesNoPrompt(prompt string) (bool, bool) { m.Display() screen.ShowCursor(Count(m.message), h-1) screen.Show() - event := screen.PollEvent() + event := <-events switch e := event.(type) { case *tcell.EventKey: @@ -149,7 +149,7 @@ func (m *Messenger) Prompt(prompt, historyType string, completionType Completion m.Clear() m.Display() - event := screen.PollEvent() + event := <-events switch e := event.(type) { case *tcell.EventKey: diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index 5598ebcc..2161f0dc 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -52,6 +52,9 @@ var ( // This is the currently open tab // It's just an index to the tab in the tabs array curTab int + + jobs chan JobFunction + events chan tcell.Event ) // LoadInput loads the file input for the editor @@ -245,14 +248,33 @@ func main() { L.SetGlobal("MakeCommand", luar.New(L, MakeCommand)) L.SetGlobal("CurView", luar.New(L, CurView)) + L.SetGlobal("JobStart", luar.New(L, JobStart)) + L.SetGlobal("JobSend", luar.New(L, JobSend)) + L.SetGlobal("JobStop", luar.New(L, JobStop)) + LoadPlugins() + jobs = make(chan JobFunction, 100) + events = make(chan tcell.Event) + + go func() { + for { + events <- screen.PollEvent() + } + }() + for { // Display everything RedrawAll() - // Wait for the user's action - event := screen.PollEvent() + var event tcell.Event + select { + case f := <-jobs: + f.function(f.output, f.args...) + continue + case event = <-events: + } + if TabbarHandleMouseEvent(event) { continue } diff --git a/cmd/micro/plugin.go b/cmd/micro/plugin.go index 3ac7ebae..c68faa0e 100644 --- a/cmd/micro/plugin.go +++ b/cmd/micro/plugin.go @@ -23,12 +23,15 @@ func Call(function string, args []string) error { if luaFunc.String() == "nil" { return errors.New("function does not exist: " + function) } - luaArgs := luar.New(L, args) + var luaArgs []lua.LValue + for _, v := range args { + luaArgs = append(luaArgs, luar.New(L, v)) + } err := L.CallByParam(lua.P{ Fn: luaFunc, NRet: 0, Protect: true, - }, luaArgs) + }, luaArgs...) return err } @@ -57,6 +60,15 @@ func LuaFunctionCommand(function string) func([]string) { } } +func LuaFunctionJob(function string) func(string, ...string) { + return func(output string, args ...string) { + err := Call(function, append([]string{output}, args...)) + if err != nil { + TermMessage(err) + } + } +} + // LoadPlugins loads the pre-installed plugins and the plugins located in ~/.config/micro/plugins func LoadPlugins() { files, _ := ioutil.ReadDir(configDir + "/plugins") diff --git a/cmd/micro/runtime.go b/cmd/micro/runtime.go index 478128be..94b15f8a 100644 --- a/cmd/micro/runtime.go +++ b/cmd/micro/runtime.go @@ -255,7 +255,7 @@ func runtimeHelpHelpMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "runtime/help/help.md", size: 7354, mode: os.FileMode(420), modTime: time.Unix(1465426120, 0)} + info := bindataFileInfo{name: "runtime/help/help.md", size: 7354, mode: os.FileMode(420), modTime: time.Unix(1465426148, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -275,12 +275,12 @@ func runtimePluginsGoGoLua() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "runtime/plugins/go/go.lua", size: 1032, mode: os.FileMode(420), modTime: time.Unix(1465409773, 0)} + info := bindataFileInfo{name: "runtime/plugins/go/go.lua", size: 1032, mode: os.FileMode(420), modTime: time.Unix(1465426148, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _runtimePluginsLinterLinterLua = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8c\x55\xdb\x6e\xe3\x36\x10\x7d\xf7\x57\x10\x44\x55\x88\x89\xa4\xa0\x79\x34\x90\x02\xdb\x14\x0d\x50\x6c\xbb\x0b\x64\xdb\x7d\xe8\x65\x41\x4b\x23\x8b\x0d\x45\x0a\x24\x15\xc7\x28\xfa\xef\x1d\x92\x8a\x2c\x2b\x4a\xb4\x46\x10\x8e\xa9\x99\x73\xe6\x72\x3c\x12\x35\xb9\x03\xf7\xa1\x73\x42\xab\x94\x4a\xa1\x1c\x18\xca\xc8\xcd\x0d\x51\x42\x12\xd7\x80\xda\x10\xfc\xbc\xab\xaa\x99\x4f\x46\x9c\xe9\x81\x6d\x40\x55\x9b\x4d\xdd\xab\xd2\x3f\x25\xf1\xe1\x17\xad\xee\xf9\x23\xa4\x2c\xc4\xbe\x42\x31\x62\xfb\x8f\xd4\x25\x97\xa4\x76\xe4\x86\xdc\xf6\xe6\x77\x01\x87\x94\x15\x3f\xf4\x75\xf1\x93\x90\xf0\xe9\xd8\xc1\xdc\x13\xaf\x5f\xf8\x7e\xe4\xae\x99\xf9\x55\xf0\xa8\x7a\x29\xd1\x95\x5e\xa1\x7d\xe5\xbf\xd0\xd1\x07\x33\xfb\x70\xef\x6b\xa5\x07\xa1\x2a\x7d\xb0\xf4\x3c\x2b\xff\x99\x20\xfc\xfa\xdb\xfb\x53\xac\xaf\x7b\x82\xe3\x53\x47\x97\x3b\xbd\x00\x31\x34\xc5\x1f\x29\xdd\xeb\x5d\x2f\x64\x85\xfd\x43\x93\x04\x9b\xe4\x9a\x50\x52\x14\xcf\x5c\xf8\x28\xa9\xb7\x89\xdc\x92\xa4\xa5\xec\x2d\x28\x7f\x46\x24\x6f\x45\x90\x97\x3d\x19\xf1\x92\xea\x72\x86\x09\xd2\xc2\x29\xfb\xf7\x3d\x5f\x4b\x5f\xf6\xbc\x6c\xa0\x7c\xf0\xac\xcf\x36\xc9\x73\xa5\xf3\x52\x4b\x6d\x62\x0a\x7e\x3a\x5f\x4d\xfa\xf1\xe8\x1a\xad\xd6\x78\xbb\x63\x2d\xf9\x03\x58\xcf\xfb\x6c\x2f\x90\xbd\x45\x74\xbb\x3a\x9a\xb2\x0c\xcd\x2c\x4b\x92\xd7\xf6\xa8\x1c\x7f\xca\xb5\x92\x47\x92\x7f\xe6\xa8\x80\xfc\x33\x3c\x39\xc3\x5f\x29\xb1\x78\xbb\xca\x1f\xd7\xc8\xab\x36\x68\x02\x0f\x12\x5b\x79\xa3\xeb\x1a\x95\x91\x93\xfc\x80\x7f\x02\x6f\x67\xcc\x49\x9a\xc8\x84\xad\x11\xff\xcc\x1f\x57\x87\xfa\x0f\xfa\x84\xd2\x83\xb1\xd4\x56\x30\x46\x9b\x55\x9e\xfb\xd2\x88\xce\xad\xb2\xd9\x66\x90\x6d\xb4\xe6\x7c\xde\x1b\x48\x22\xb3\xe2\x32\x9b\x31\x0e\xbf\x39\xcf\x3c\x5e\x8e\x7a\xdf\xde\x4a\xe0\xe6\x9d\x94\x77\xbd\x43\xb6\x5f\xc0\x5a\xbe\x07\x3b\x6c\x21\x1f\xbb\xb8\xab\x42\x52\xd1\xce\x48\xd9\x56\x59\x2c\xb6\xd6\xa6\xe5\x2e\xc6\xce\x28\x66\xf8\x31\x96\x6d\x82\x6b\x5c\x3b\x0d\x57\x55\x58\x50\x42\x17\x9d\xee\x00\xf7\x5e\x1a\xaa\x44\x7c\x7f\x50\x16\xbe\x51\x72\xfd\xfd\xb7\xdf\x0d\x05\xc6\x48\x5f\xbb\xc5\xc0\x21\x39\xdb\x49\xe1\xd2\x08\xb7\x35\xc0\xab\x94\x5e\x70\xca\xb0\x51\x7f\xaa\x21\x6e\x78\x58\x4a\x6d\xfd\xc6\x9d\x60\x19\xd8\xc3\x13\x62\x4d\xea\xd9\xee\x6d\xbf\x4b\x69\x92\xd4\xbe\xff\x69\x71\xc9\x28\x1b\xef\x64\xb8\x43\x31\x4f\x2f\xdb\x93\x63\x80\x46\x1c\xf2\x25\x0b\x23\x12\x8a\x88\x8e\x0b\x13\x5a\x00\x96\x91\x4a\x8f\x53\xc9\x73\xf2\xc9\x88\x96\x1c\x1a\xe1\xc0\x76\xbc\x9c\x6c\x70\x1f\x1b\x2a\x84\x2d\xa6\x54\x36\x29\xfd\x3b\xb1\x17\x9e\x03\x8f\x6f\x26\xf3\x46\x75\x59\x67\x84\xda\x17\x35\xee\xe7\xc0\x92\xc5\xaa\xd8\x82\xc6\xc6\x17\x43\x46\xa2\x67\x6b\xf7\xc8\x33\x20\x44\xa6\x29\xc4\x59\x34\x52\x0d\x2d\xdf\x71\x0b\x8a\xb7\x90\xbe\x5c\xa4\xe1\xbd\x38\x77\xf3\x8c\x0b\xe9\x9c\xeb\xe6\x4c\x32\xa3\xda\x9c\x56\x7d\xbb\x03\x13\xd2\x62\x21\xe1\x8c\x5c\x9f\x27\x36\x7d\xcf\x8c\xfa\x7f\x4d\xcb\x51\x2e\x58\x71\x46\x2c\x74\xec\x4c\x0b\xb6\x97\xfe\xf5\xfa\xef\x7f\x0b\x0a\x41\x79\xfe\x81\x33\xf8\x2b\x4c\x3e\x2a\x25\x1d\x01\xfc\xc4\x01\x37\xbd\x9f\x37\x42\x6f\xf7\xb1\x95\xc3\x1c\x26\x33\x77\x7c\x27\xa1\x10\xca\x82\x71\x69\x24\xcc\x42\xe4\xe9\x17\xe8\x4f\x03\xae\x37\x6a\xc8\x68\xb9\x8e\xf3\xe6\x4e\x12\xf6\x97\xa7\x99\x06\x8d\x0e\x8b\x23\x2d\x2e\xae\x18\xfe\x63\x5e\xaf\xc9\xf5\xa0\xa2\x81\xcb\x87\x05\xa6\xff\x03\x00\x00\xff\xff\xc7\x61\x41\xe2\xef\x08\x00\x00") +var _runtimePluginsLinterLinterLua = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8c\x55\x5d\x8f\xa3\x36\x14\x7d\xcf\xaf\xb0\xac\x22\xc1\x0e\x30\xd2\x3e\x46\xca\xc3\x76\xda\x8e\xb4\xda\x76\x57\xca\xb6\xfb\xd0\x8f\x91\x03\x97\xc4\x1d\x63\x23\xdb\x4c\x12\x55\xfd\xef\xbd\xb6\x09\x01\x86\x0c\x45\xbb\xb1\xc7\xdc\x7b\xce\xfd\x38\x5c\xf3\x8a\x3c\x82\xfd\xdc\x58\xae\x64\x4c\x05\x97\x16\x34\x4d\xc8\x66\x43\x24\x17\xc4\x1e\x40\xae\x08\x3e\x1f\xca\x72\x62\x93\x12\xab\x5b\x48\x56\x20\xcb\xd5\xaa\x6a\x65\xe1\xde\x92\xf0\xf2\x49\xc9\x2d\x7b\x81\x38\xf1\xbe\x37\x28\x7a\x6c\xf7\x08\x55\x30\x41\x2a\x4b\x36\xe4\xa1\xd5\xbf\x71\x38\xc6\x49\xfe\x7d\x5b\xe5\x3f\x71\x01\x5f\xcf\x0d\x4c\x2d\xf1\xf8\x95\xed\x17\x66\x0f\x13\xbb\x12\x5e\x64\x2b\x04\x9a\xd2\x7b\xdc\xdf\xbb\x3f\x68\x6f\x83\x91\x7d\xde\xba\x5c\xe9\x91\xcb\x52\x1d\x0d\x1d\x47\xe5\x9e\x01\xc2\x2f\xbf\x7e\xba\xfa\xba\xbc\x07\x38\x2e\x74\x34\x79\x54\x33\x10\x5d\x51\xdc\x12\xd3\xbd\xda\xb5\x5c\x94\x58\x3f\xdc\x12\xbf\x27\x99\x22\x94\xe4\xf9\x85\x0b\x5f\x45\xd5\x3a\x12\x6b\x12\xd5\x34\x79\x0b\xca\xad\x01\xc9\xed\x02\xc8\xeb\x9a\xf4\x78\x51\x79\x37\xc1\x04\x61\xe0\x1a\xfd\xa7\x96\x2d\x85\x2f\x5a\x56\x1c\xa0\x78\x76\xac\x97\x3d\xc9\x32\xa9\xb2\x42\x09\xa5\x43\x08\xae\x3b\xff\x9b\xf4\xcb\xd9\x1e\x94\x5c\xe2\x6d\xce\x95\x60\xcf\x60\x1c\xef\x65\x3f\x43\xf6\x16\xd1\xc3\x62\x6b\x8a\xc2\x17\xb3\x28\x48\x56\x99\xb3\xb4\xec\x94\x29\x29\xce\x24\xfb\xc6\x50\x01\xd9\x37\x38\x59\xcd\x6e\xa4\x98\xbf\x9d\xe5\x0f\x4b\xe4\x65\xed\x35\x81\x0b\x09\xa5\xdc\xa8\xaa\x42\x65\x64\x24\x3b\xe2\x3f\x8e\xa7\x13\xe6\x28\x8e\x44\x94\x2c\x11\x7f\x64\x2f\x8b\x4d\xfd\x1b\x6d\x7c\xea\x7e\x33\x57\x56\xd0\x5a\xe9\x45\x9e\x6d\xa1\x79\x63\x17\xd9\xcc\xa1\x93\x6d\xd8\x4d\xf9\x9c\x35\x90\x48\xa4\xf9\x5d\x3a\x61\xec\xbe\x39\xc7\xdc\x1f\xf6\x7a\x5f\x3f\x08\x60\xfa\x83\x10\x8f\xad\x45\xb6\x9f\xc1\x18\xb6\x07\xd3\x4d\x21\xe7\x3b\x3b\xab\x7c\x50\x61\x9f\x92\xa2\x2e\xd3\x90\x6c\xa5\x74\xcd\x6c\xf0\x9d\x50\x4c\xf0\x83\x6f\xb2\xf2\xa6\x1f\xd5\x6e\x6b\x99\xb6\xb1\x47\xa2\xb4\xfb\xdf\xcf\xc5\x1f\x4f\xdc\xa5\x7e\xe1\x1b\x51\xdd\x18\xa5\xce\x25\x56\xad\x6d\x5a\x7b\xc3\xd1\x97\xd8\xcf\x3b\x57\x3a\x83\xb3\xaa\x73\x36\x8d\x18\xf8\xd2\x3f\x24\xed\xc2\x0c\xd6\x1a\xf6\x70\x42\xeb\x01\xd8\x7a\x6f\xda\x5d\x4c\xa3\xa8\x72\x61\xc7\xf9\x5d\x42\x93\xfe\x4c\xf8\x33\x54\xfb\xf0\xb0\xbe\x1a\x7a\x68\xc4\x21\x4f\xa9\xef\x21\x97\x84\x37\x8c\x6b\x5f\x23\x30\x09\x29\x55\xdf\xb6\x2c\x23\x5f\x35\xaf\xc9\xf1\xc0\x2d\x98\x86\x15\x83\x11\xef\x7c\x7d\x0e\xb0\xc6\x90\x8a\x43\x4c\xff\x8a\xcc\x3b\xc7\x81\xcb\x77\x03\x41\xa0\xfc\x8c\xd5\x5c\xee\xf3\x0a\x07\xb8\x67\x49\x43\x56\xc9\x8c\x08\xfb\x9b\xc3\x97\x11\x7f\x6b\xb3\x47\x9e\x0e\x21\x30\x0d\x21\x46\xde\x48\xd5\x15\x75\xc7\x0c\x48\x56\x43\xfc\x7a\xd2\xfa\x8b\x73\x6a\xe6\x18\x67\xc2\x19\x0b\x6b\xa4\xa9\x5e\x8e\x56\xc9\xb6\xde\x81\xf6\x61\x25\x3e\xe0\x94\xbc\x1f\x07\x36\xbc\x88\xfa\x0f\xe4\x96\xd8\x83\x20\x30\xe3\x94\x18\x68\x92\x91\x16\x4c\x2b\xdc\xfd\xfb\xcf\xbf\x33\x0a\x89\x69\xfc\x3b\xf6\xe0\x4f\xdf\xf9\xa0\x94\xb8\x07\x70\x1d\x07\xbc\x0a\x5c\xbf\x11\x7a\xbd\x0f\xa5\xec\xfa\x30\xe8\xb9\x65\x3b\x01\x39\x97\x06\xf0\x03\x09\x84\xa9\xf7\xbc\x7e\xa2\x6e\xd5\x60\x5b\x2d\xbb\x88\xe6\xf3\x18\x17\x77\x10\xb0\x3b\xbc\xf6\xd4\x6b\xb4\x9b\x2c\x71\xfe\xee\x3e\xc1\x9f\xc4\xe9\x35\x7a\xdf\xa9\xa8\xe3\x72\x6e\x9e\xe9\xbf\x00\x00\x00\xff\xff\xed\x68\xe6\x7c\x10\x09\x00\x00") func runtimePluginsLinterLinterLuaBytes() ([]byte, error) { return bindataRead( @@ -295,7 +295,7 @@ func runtimePluginsLinterLinterLua() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "runtime/plugins/linter/linter.lua", size: 2287, mode: os.FileMode(420), modTime: time.Unix(1465409773, 0)} + info := bindataFileInfo{name: "runtime/plugins/linter/linter.lua", size: 2320, mode: os.FileMode(420), modTime: time.Unix(1466003634, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -620,7 +620,7 @@ func runtimeSyntaxCsharpMicro() (*asset, error) { return a, nil } -var _runtimeSyntaxCssMicro = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x6c\x8f\x31\x6f\xc3\x20\x10\x85\x77\xff\x8a\xd3\x39\x43\x9b\xc1\xd9\x89\x3a\x75\xe9\x9e\xb1\xb4\x12\xb6\xcf\x31\x2a\x85\x8a\x23\x4e\x2c\x5f\xff\x7b\x71\x55\x2a\x59\xca\x0d\x08\x78\x1f\x8f\xf7\xea\x1a\x5e\x28\x12\x58\x06\xe3\x81\x6e\xe6\xf3\xcb\x11\x0c\x21\x42\xc7\x0c\x83\x75\xc4\x4d\x55\xd7\x55\xc5\xb3\x4f\xe6\x06\xf8\x7c\x3a\x21\xa0\x6e\x1e\xb2\x2e\x9c\x97\xc7\x1d\x56\x5d\x70\xf9\x45\x1b\xed\x79\x4c\x91\x7a\x58\x07\x9b\xed\xfd\x4c\xce\x85\x2b\x00\x27\x13\xd3\x13\xea\x05\x81\x7c\x9f\x37\xdf\x5b\xee\x3a\xda\x44\xf0\xcf\xa9\x3f\xec\xf5\xf8\xae\x97\xb7\x2d\xda\xba\x0b\xfd\x7e\xa5\x4c\x97\xec\x44\xa2\x86\xd0\x5d\x58\xd4\x18\x26\x8a\xa2\x9c\xf5\x1f\xa2\x26\xcb\xd9\xb1\x2f\x47\x33\xa4\x55\x6b\x29\x97\x24\xd9\xdd\x77\x2c\x21\x0f\x7a\x5f\x62\xee\xf5\xa1\xb0\xe7\x48\xe4\xa1\x0c\x1e\x45\x89\x5e\x64\x2d\xf2\x13\x00\x00\xff\xff\xd2\xcc\x92\x6e\x4f\x01\x00\x00") +var _runtimeSyntaxCssMicro = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x74\x59\xcb\x92\xe3\xb6\x15\xdd\xcf\x57\x28\x8a\x2b\x33\x3d\x15\x8e\xf7\xed\x3c\x16\x71\x52\xe5\x45\xca\x8b\x64\x31\x55\xd6\xb8\x0a\xa2\x20\x11\x23\x92\xa0\x01\xb0\xbb\xd5\x43\xe7\xdb\x73\xee\x03\x24\x28\xa9\x37\xd4\x3d\x07\x20\x1e\x17\xf7\x05\x2a\x5e\xfa\x64\x5e\x36\xdb\x3a\xc6\xed\x66\xbb\xfb\xf4\x01\xc2\x14\xf1\x78\xf8\x6e\xfb\xee\xdd\x1f\x37\xff\x68\x4d\x8c\x36\x6e\x4c\x7f\xd8\xfc\xf4\x63\x7c\x57\xfb\xd6\x87\x4d\x4c\x26\xd9\xce\xf6\x69\xf3\xc1\x3d\x6c\xb6\x9f\xb6\xca\xf7\x3e\x74\xa6\xa5\xe6\x90\xfe\xba\xdd\x7d\xdb\x6e\x6c\x7f\x80\xf0\x3b\x8f\x85\x51\x37\xb5\xef\x3a\x8c\x95\x07\x4a\x97\xc1\x6e\xb6\x1f\x4c\xeb\x4e\x7d\x55\xfb\x3e\x61\xcc\x49\x90\xc3\x0c\x51\x64\x9a\xa9\xda\x9b\x68\x5b\xd7\x5b\x6d\x06\x38\x42\x6c\x27\xd3\xbb\xce\x24\xe7\xfb\x45\xaa\x0e\xb6\x35\x97\x12\xbb\x60\xeb\xeb\x3e\x63\xb8\x7e\xed\xe8\xda\xb6\xea\xfc\xc1\x16\x1c\x96\x21\xfd\xb0\xbc\x91\x16\x37\xb7\xf4\xa6\x2b\x3b\x0e\x98\xb2\x62\xc5\x14\x64\x72\x9d\xeb\x4f\xd5\x71\xec\x75\xfa\x61\xb0\x26\x98\xbe\x46\xa7\x57\xd7\x8d\xa9\x99\xf6\xa6\x3e\x1f\x4d\x6d\xab\x27\x17\xdd\xde\xb5\x2e\x5d\x98\x3b\x05\xcc\x77\x28\xc4\xca\xa4\x64\xea\x86\x94\x51\xb2\xfb\x16\x3a\x96\x55\x17\x6c\xdd\xba\x61\x85\x49\xdd\x25\x81\x15\x9e\x56\x6f\xf8\xe0\x4e\xae\x2f\x99\xc1\x47\xc7\xab\x2e\xb8\x60\xb1\x81\xd5\xfc\xd1\xbd\xd2\x38\x72\x38\x55\x6c\xdc\x11\xcd\xde\x9f\x3b\x13\xce\x55\x6b\xf6\xb6\x2d\xa0\x7d\x2a\xa1\x68\x6b\xef\xc3\xc1\x06\xfd\xa9\xf6\x3e\x25\xdf\xad\x51\x5e\xfd\x8a\x6b\xed\x31\x55\xc1\x1c\xdc\x18\xaf\x5a\xb0\x91\xe6\x8d\xa6\x98\x2e\xad\xbd\xe2\x9e\xdd\x81\x8e\x21\x73\xd8\x93\x09\x97\x8c\x31\x73\x6b\x86\x68\x0b\xbc\xac\x44\x75\x58\x80\xca\x8f\x29\xda\xb4\xe6\xb2\xce\x4a\x2e\xb6\xae\xbe\x7a\x35\xfa\x31\x5c\x73\xab\xb5\xd1\x8e\x4b\x79\xbd\x18\x66\x56\xfb\x63\x66\x35\xc2\x5a\x27\xac\xa7\x15\x58\x8f\x28\xd4\x6a\x48\xa1\x56\x63\xc6\xc1\xd4\xb0\xf1\x19\x96\xdd\x93\x1f\x0a\x71\x3d\x3a\x11\x77\xce\x90\xe8\x7b\x07\x48\xfc\xf5\xd8\xeb\x85\x64\xa0\xf6\xf3\x82\x28\x50\x7b\xf5\xdd\x7d\xb0\xe6\xcc\x64\x6c\xcc\xc1\x3f\x8b\xe8\x5e\x65\xe1\x10\x7b\x33\x88\x30\x0e\x43\xb0\x88\x81\xfc\x46\x65\x8e\x89\x4c\x93\xe5\xbd\x3d\xfa\x60\x15\xb8\x3e\x3a\x78\x5c\x6d\x06\x1e\x5f\x41\xc0\xd1\xf3\xb3\x5a\xa2\x92\x60\xd9\xba\xc8\x58\xc2\x80\xde\x8d\xc1\x20\x53\xdd\x22\x20\x4c\xec\xae\xf4\xa8\x06\x83\x4d\xb0\x14\x46\x6c\x56\xdf\xa3\x27\xe6\xc4\x62\x06\xdf\xce\xc1\x0a\x30\x52\xdb\xd8\xe5\xe8\xa4\x80\x02\x59\x96\x4f\xd8\x99\x8a\x79\xc4\x2c\x57\xf3\xe8\x33\x23\x2a\x2e\x19\x51\xab\x30\xf3\x6c\x38\xf4\x3e\xcb\xb9\x83\x04\x6f\xfa\x75\xfd\x48\x63\x8c\xb4\x5e\xac\xba\x0e\x9c\x2b\x66\x06\xfa\xb5\x0b\x62\x99\xfa\x8f\x56\xd5\x4d\x92\x2a\xbb\x1e\x43\xc4\x0a\x97\xf8\x7d\x70\x91\x02\xed\x74\xf0\x08\xac\xa6\x4c\x0b\x16\xc1\x45\x34\x6e\xbb\x21\x5d\xaa\xda\xb6\x6d\x9c\x44\x4b\xd3\xb1\xb5\x2f\xfc\xa0\xfe\x2e\x8a\xb8\x8c\xca\xf0\xd8\xc2\x2e\x58\x42\x64\x53\x29\x36\xc1\xf5\x67\x91\x9f\x03\x34\x89\x4e\x70\x65\x7e\xc2\xbe\x8e\x3c\x34\xc9\xfe\x78\xa4\x8d\x08\x08\xd4\x60\x29\xc8\x03\xfb\x1c\x7c\x45\xf6\xe4\x2e\x08\xf1\x3a\x9b\x7f\xae\x8e\x01\xf6\xca\x12\x0e\xd8\x4f\x47\x28\x90\x1f\xd5\xd1\x74\xae\xbd\xa8\x8c\x08\x32\x06\x4b\xda\x82\x7a\x4f\x51\xd8\xb3\x0d\x3d\x99\x30\x83\xd6\xf4\xa7\x91\x63\xd0\x93\x0d\x81\x0c\x92\x69\x8e\xcf\xb3\x54\x99\xc3\xd7\x31\xea\x04\x31\xc1\x1c\xeb\x26\x03\x3a\x79\x11\x51\x14\x34\x96\xf5\x44\xf0\xc9\x04\x67\xf2\xa2\x14\x54\x86\xf4\xda\x23\x7e\xaf\x3b\x55\xf0\x88\x2b\xc6\x9a\x88\xee\x11\xf2\x9a\x47\x1a\xe7\x3d\x5d\x75\xef\xc7\xce\x06\x57\xaf\xc9\x39\x15\x31\xfb\x6c\x39\x72\x1d\xbd\x4f\xbd\x4f\xb6\xca\x46\x31\x13\x70\x12\x57\x5f\xa6\x53\x7b\x19\x1a\x4a\x6c\xb0\x3e\x71\x1a\x68\x26\xb9\xda\xb4\xd3\x09\x0a\xe2\x47\x05\x97\x34\x2a\x8d\xc9\x57\xd9\xd0\x17\x86\x4f\x6a\x81\xb0\x0d\x6d\x95\xae\xa5\x5c\x21\x15\xaf\x30\x39\x5f\x89\xb9\x32\x12\x66\x6e\x0a\x79\x78\x08\xcb\x00\x04\xca\x2e\xe5\xab\xa8\x8c\xb0\x5f\xa4\xce\x15\xe2\x9d\xc4\x2b\x6e\xb5\x9d\x99\xe5\x3d\x34\xb0\x17\x2a\x4e\x06\x2a\x4e\x46\x71\x9d\x46\x34\xdb\x40\x6f\xb6\xe7\xf7\x1b\x94\x2b\x35\xb9\xd0\xc2\xb5\x28\x6a\x12\xb7\xc4\x1b\x16\xe5\x62\xba\x25\xe1\x9f\xb7\x5d\x5f\x3d\xbc\x56\xc8\x38\x69\xf6\x5c\x8e\x6a\xca\xb9\xb3\x47\x6c\x27\x1b\xcf\x38\x62\x47\xd2\xa1\x87\x49\x98\x16\x49\x24\xd1\xfa\xd6\xb0\xe2\x2a\xf1\x9a\x64\x17\x76\x51\x43\xe8\x44\x9e\xe0\x8e\x97\xb9\xf0\xcc\x58\x4a\xcf\x8c\xb8\xd2\xe4\xdc\xab\xa3\xe4\x8c\xd7\x92\xae\x48\x83\xe2\xdf\x5c\xff\x48\xa2\x61\x91\x4d\x8c\x25\xd5\xaa\x14\x48\x94\x69\x5a\x17\xb3\xc3\x2d\xa2\x96\x13\x05\x31\x5b\x7d\xc1\x51\xc5\x3c\xa1\x7a\xa2\x5a\x4d\x7e\x72\xc9\xa4\x88\x57\xaa\xb2\x64\x78\x05\x94\x8c\xa9\xec\x82\xae\xe4\x87\x8d\x4d\xc5\x73\xef\xeb\x33\x8a\x97\xf9\xf5\x15\x39\x8f\x43\x6c\xe7\xe6\xb7\x90\xac\x28\x0a\x64\x18\xed\x89\x03\x7d\x86\x14\x83\xb2\xcc\xd6\x0b\xf0\xdb\x68\x6d\x11\x79\x33\x83\xd8\x38\xcc\x20\x0e\xd6\x1e\x16\xc4\x7a\xea\x4c\x3c\xf3\xa3\xd2\x7a\xb1\x90\xa5\xfa\x2d\x09\x2d\xc3\x4a\x4a\xab\xb0\x92\x92\x22\x6c\xc5\x48\x0d\x56\x52\x92\xde\x98\xe1\x2c\x2d\x92\xef\xf8\x70\xb4\xab\x9c\x1c\x8b\xcb\x52\xb4\xa0\x66\x79\x3e\x49\x46\xe5\x52\x38\x3c\xb3\xa4\x27\xfb\x92\xcd\x85\x44\xf1\x1c\x92\x74\x19\x38\xc7\xdc\xec\xfa\x99\x7c\x29\x6f\x01\x9d\x97\x99\xf8\x27\x27\x26\x45\x5c\x5d\xa8\x1c\xbc\x7a\x5a\x6f\x9e\x2a\xd4\x44\x22\xf0\xf9\x93\x20\x67\x4e\xd2\x38\x4c\x7e\xff\x15\x07\x86\xba\x22\x65\x71\xde\x91\x4c\xa0\xa9\x5b\x81\x66\x6f\x45\x64\x66\x2a\x8a\x19\xe4\x1c\x28\x07\xe9\xc3\x80\x50\x14\x27\x9c\x19\x27\x72\xfd\x55\xaf\xca\x48\xf7\x91\xa1\x18\x45\x46\xa2\x07\xca\x7b\x1c\xac\xb3\x90\x7b\x65\xc8\xee\x3f\xa3\x97\x45\xbc\x4c\x83\x39\x1c\xc8\xa7\xf5\x37\xfb\x54\x86\xac\x95\x0c\x44\x33\x19\x91\x5b\x0d\x74\xfc\xf4\xa8\xca\xb2\xb1\x20\x54\x21\x05\xa3\x05\xe4\x60\xc6\xa8\xcf\xf9\x2d\x92\xf3\x0b\xa8\xf0\x06\x72\x95\xa7\x95\x9c\x6d\x6b\x70\x94\xbe\xf9\x89\x72\xb9\xa7\x45\xd0\x2d\x14\x57\x5b\xde\x0b\xe2\x1c\x02\x61\x5f\x37\xd0\x63\x06\x27\x28\x44\x64\x64\xcd\xc4\x37\x51\x81\x79\xc8\x7c\xae\x54\x06\xcf\x79\x53\x2e\x6e\xbf\x8d\x9e\xf2\x7d\xb0\x27\x2e\x40\x83\x11\x77\x47\x47\x32\x62\xfc\xb0\x9c\x6d\x81\x45\xdd\x07\x12\x7a\xd3\x53\x59\x2d\xba\x9b\x4d\x2f\x0b\x30\x27\x47\x23\x8d\xfb\x8b\x46\x6e\x16\x51\x09\x60\x4f\x2c\xce\xeb\x0a\x63\xcf\x35\x4f\xac\x03\xee\x66\x98\xa0\x31\x4f\x0e\x1b\x54\x4c\xf1\x55\x87\x28\x19\x8d\x98\xb7\x14\x3c\x07\x41\xee\xcd\x06\x36\xde\x37\x1b\xc5\x9c\xef\x35\x8b\xf9\xdc\x69\x71\x3d\x1b\xf9\x9b\x2d\x6f\x4d\xa8\xad\x6f\xce\xc8\x16\x7a\x87\x17\x85\xdf\x69\x20\xbb\x2d\xe9\xec\x01\x77\xb8\x3b\x3a\x5a\xb5\xdc\xac\x79\xdd\x7a\xbb\xe6\x2b\x2f\xbb\xd7\x74\x47\x4f\xeb\xa6\x37\x27\x7d\x53\x53\x2b\x67\xbe\xd7\x70\xab\xab\xd2\xc9\x4b\x9e\x63\x35\xdf\xe3\xf4\xa2\x9e\x1a\x98\x7b\xe3\xdb\x43\x66\xc5\xbd\x05\x64\xe3\x63\x40\xa9\x89\x9b\xc8\x67\xe0\xd0\x28\x17\xf8\x89\x12\x59\x85\xc6\x1a\x8a\x8b\x02\xb8\x1c\x46\xc1\x2a\xa8\xac\xd5\x28\x4b\xb2\xdf\x23\x0b\x51\x25\x4f\x1f\xee\x12\x39\x3e\x5f\xa9\x20\xfa\xb3\xd5\x9f\x6a\xfe\x8c\x96\x89\x83\xa1\x8b\x30\x5f\x05\x4a\x26\x04\x94\xd1\x05\x81\x0b\x74\x4f\x4b\x59\x18\x8d\xc3\xca\x90\xa6\x51\xf1\x97\xf0\xab\xa7\xad\x0a\xee\xe8\xeb\x19\x57\x7b\x99\xc9\xa1\x5f\xa1\x04\xee\x64\x90\xbe\x50\x3a\x5e\xa0\x1b\x02\x92\x14\x93\x7d\x49\xea\xc9\x8b\x58\xd1\x27\xbf\x02\x72\xbd\xc9\x18\x29\x79\x4f\xe7\x3e\x0e\x72\x8c\x4c\x2e\x9f\x00\xae\xb1\xa6\x97\x6b\x96\x8d\xee\x9a\x8c\x67\xe4\xfd\x1b\x92\x73\x0b\xb3\x28\xab\x1b\xbe\x56\xae\x50\x39\xc3\xcc\xcd\x61\x6c\x4d\x17\x83\x39\x14\xbc\xbd\x2e\x5f\x4b\x50\x01\x65\x71\x2c\x44\xce\x77\x8c\xf4\xc3\x86\xc8\x03\x7d\x50\x9c\xbf\x5d\x15\x1c\x0c\xa4\x5b\x30\xf9\x3b\x83\x84\xec\x11\x11\xa9\xb5\x6d\xa4\xa2\x9b\xbd\x68\xbd\x5e\x4e\xa0\xe4\x0b\x45\xff\x2c\xc1\x99\x5f\x0a\xa4\xe9\x64\x21\x74\x8b\x84\x75\xc4\x59\xd4\xef\xb5\x25\x91\x3f\xce\x16\xdc\x10\x3c\x52\x60\x5a\xf5\xbb\xfe\xbe\x3a\xf6\xae\x46\x0d\x54\xed\xdd\xc1\x4d\xc8\xa3\x54\x93\xb6\xc8\x99\x53\xbe\xf8\xa9\x41\x15\xdf\x5a\x9f\x3c\x8a\xc0\x6a\x6f\x5a\xce\x85\x82\xe6\xe9\x05\xea\x45\x5c\x80\xe4\x5c\x91\x25\xe7\x66\x39\x65\x51\xbd\x51\xc0\x13\xdd\xc0\xa8\x85\x7f\x9e\x1b\xb8\x84\x9c\xc5\x04\xe3\xa7\x7b\x98\xf8\xc0\x33\x7d\x7b\xae\x1b\x1e\xf0\x19\x85\x91\xde\x24\x58\xcc\x47\xc5\x80\xcf\x80\x1e\x9a\x66\x59\xd4\x34\xcb\x32\x9b\x04\x4b\x1a\x84\x58\x46\x80\xf2\xe3\x09\xf3\x04\xc7\x77\x16\x2e\x15\x5f\xd9\xda\x5e\x1e\x1e\xef\x7f\xc0\x7f\xd4\xef\xf7\xbf\xfc\xf0\xeb\xee\xdb\x97\xdc\x87\x8a\x10\xdc\xa9\x36\xdb\x3f\x38\x14\xc1\x01\x35\x44\xca\x4d\x8e\x4c\xd7\x1d\x9d\x0d\x9b\xed\xa3\x91\xb2\xe5\xf1\xe8\xeb\x31\x4e\x8f\x0d\x99\xeb\xf4\xd8\xd2\xf7\x94\x47\xd2\x7f\x42\x8d\xaf\x50\x76\xf2\xa8\xbb\xf8\xee\x66\xa6\x0f\xbb\x6f\xd3\xee\xf7\x69\xf7\x61\xda\x3d\x4c\xbb\x1f\xa6\xc7\x69\xf7\x65\xfa\xdf\xf4\x97\xe9\x6f\xd3\x9f\x1f\xf8\xbf\x85\xff\x70\xe4\xcb\x7f\x2b\xe0\x42\x47\xb5\x4d\xda\x6c\xf1\xea\xee\xd3\xf4\xcb\xaf\xdb\x2f\x0f\x1f\xb7\xdb\x9b\xe6\xf7\xda\xfc\x1e\xcd\xef\x6f\xa6\xdd\xde\x30\xef\xe5\x4f\x11\xdf\x51\x2c\x8d\x9b\x3f\x6d\xfe\xfb\xf3\x8f\x3f\x2f\xb3\x32\x3d\xff\xfd\xf1\xfd\xee\x63\xfe\x03\xe4\xe3\xee\xfb\x3c\x56\xf2\x07\x8f\x1d\xd1\x8b\xd3\xe7\xcf\x9f\xa7\x7f\xfd\xf4\xf9\xdf\xff\x7c\x78\xfc\xfb\xf6\xdd\xff\x03\x00\x00\xff\xff\x42\xaa\x65\xae\x8c\x19\x00\x00") func runtimeSyntaxCssMicroBytes() ([]byte, error) { return bindataRead( @@ -635,7 +635,7 @@ func runtimeSyntaxCssMicro() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "runtime/syntax/css.micro", size: 335, mode: os.FileMode(420), modTime: time.Unix(1465409773, 0)} + info := bindataFileInfo{name: "runtime/syntax/css.micro", size: 6540, mode: os.FileMode(420), modTime: time.Unix(1465426145, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/runtime/plugins/linter/linter.lua b/runtime/plugins/linter/linter.lua index be7fe76f..1ecfc3d5 100644 --- a/runtime/plugins/linter/linter.lua +++ b/runtime/plugins/linter/linter.lua @@ -34,9 +34,11 @@ end function linter_lint(linter, cmd, errorformat) CurView():ClearGutterMessages(linter) - local handle = io.popen("(" .. cmd .. ")" .. " 2>&1") - local lines = linter_split(handle:read("*a"), "\n") - handle:close() + JobStart(cmd, "", "", "linter_onExit", linter, errorformat) +end + +function linter_onExit(output, linter, errorformat) + local lines = linter_split(output, "\n") local regex = errorformat:gsub("%%f", "(.+)"):gsub("%%l", "(%d+)"):gsub("%%m", "(.+)") for _,line in ipairs(lines) do