From bc6dd990e5632b0ebb8359979eb1445a3cc54ec2 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sat, 3 Aug 2019 23:53:33 -0700 Subject: [PATCH] Improve gutter messages --- cmd/micro/micro.go | 12 ++++----- internal/action/bufpane.go | 44 +++++++++++++++++++++++-------- internal/config/runtime.go | 2 +- internal/display/bufwindow.go | 4 +++ internal/display/infowindow.go | 1 + internal/display/termwindow.go | 4 +++ internal/display/window.go | 1 + runtime/plugins/linter/linter.lua | 5 ++-- 8 files changed, 52 insertions(+), 21 deletions(-) diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index 635358ff..394512a0 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -232,18 +232,16 @@ 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: } - if event != nil { - if action.InfoBar.HasPrompt { - action.InfoBar.HandleEvent(event) - } else { - action.Tabs.HandleEvent(event) - } + if action.InfoBar.HasPrompt { + action.InfoBar.HandleEvent(event) + } else { + action.Tabs.HandleEvent(event) } + log.Println("Done event cycle") } } diff --git a/internal/action/bufpane.go b/internal/action/bufpane.go index a5c8530c..969ed956 100644 --- a/internal/action/bufpane.go +++ b/internal/action/bufpane.go @@ -250,18 +250,20 @@ func (h *BufPane) HandleEvent(event tcell.Event) { } h.Buf.MergeCursors() - // Display any gutter messages for this line - c := h.Buf.GetActiveCursor() - none := true - for _, m := range h.Buf.Messages { - if c.Y == m.Start.Y || c.Y == m.End.Y { - InfoBar.GutterMessage(m.Msg) - none = false - break + if h.IsActive() { + // Display any gutter messages for this line + c := h.Buf.GetActiveCursor() + none := true + for _, m := range h.Buf.Messages { + if c.Y == m.Start.Y || c.Y == m.End.Y { + InfoBar.GutterMessage(m.Msg) + none = false + break + } + } + if none && InfoBar.HasGutter { + InfoBar.ClearGutter() } - } - if none && InfoBar.HasGutter { - InfoBar.ClearGutter() } } @@ -366,6 +368,26 @@ func (h *BufPane) Close() { h.Buf.Close() } +func (h *BufPane) SetActive(b bool) { + h.BWindow.SetActive(b) + if b { + // Display any gutter messages for this line + c := h.Buf.GetActiveCursor() + none := true + for _, m := range h.Buf.Messages { + if c.Y == m.Start.Y || c.Y == m.End.Y { + InfoBar.GutterMessage(m.Msg) + none = false + break + } + } + if none && InfoBar.HasGutter { + InfoBar.ClearGutter() + } + } + +} + // BufKeyActions contains the list of all possible key actions the bufhandler could execute var BufKeyActions = map[string]BufKeyAction{ "CursorUp": (*BufPane).CursorUp, diff --git a/internal/config/runtime.go b/internal/config/runtime.go index 4fc2f18a..b29800e2 100644 --- a/internal/config/runtime.go +++ b/internal/config/runtime.go @@ -1092,7 +1092,7 @@ func runtimePluginsFtoptionsFtoptionsLua() (*asset, error) { return a, nil } -var _runtimePluginsLinterLinterLua = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x58\xeb\x8f\xa4\xb8\x11\xff\x3e\x7f\x85\x85\x82\x04\x3b\xc0\x28\x51\x3e\x21\xb5\xa2\xcb\xe6\x2e\x52\xb4\x8f\x48\xb3\x51\x3e\xec\xee\x45\x6e\x28\xba\x7d\x63\x6c\x62\x9b\xee\xe9\x8c\xf6\x7f\x8f\xaa\x6c\xc0\xf4\x63\x6e\xf3\x18\x69\xb0\x31\xf5\xf8\xd5\xcb\x2e\xb7\xd4\x0d\x97\xcc\x8c\xca\x89\x1e\xd8\x86\x89\x7e\xd0\xc6\x65\x49\x58\x49\xf2\x3b\x4f\xd1\x09\x09\x03\x77\xfb\x88\x04\x5f\x1f\xa6\xf5\x99\xd0\xee\x41\xca\x88\xaa\x17\x8d\xd1\x0f\xb4\x3a\xd3\x6c\xc7\xae\x03\x73\x41\xe4\x97\x67\xaa\x46\xab\x4e\xec\x2e\xa8\xfc\x72\x92\xdf\x05\x32\x29\x94\x03\x63\xd9\x86\xbd\x7c\xbb\xbb\x2b\x4b\xd6\x18\xe0\x0e\x2c\xe3\xe1\x13\x03\xe5\xcc\xa9\x60\x0d\x97\x92\x75\x46\xf7\xec\x28\xdc\x5e\x28\xc6\x15\x13\x4a\x38\xc1\xa5\xf8\x17\x77\x42\x2b\xd6\x8d\xaa\xc1\x49\xc1\x94\x76\x28\xab\x15\x06\x1a\x27\x4f\x8c\xbb\x89\x96\x49\xcd\x5b\x86\xce\xb9\x2b\x4b\xa4\x51\xbc\x87\x9a\x9e\x4c\x77\xcc\xed\x21\xe8\xc5\x6f\xe8\x1e\x77\x1a\xa0\x9e\x67\xcc\x69\xd6\xec\xa1\x79\x62\x9d\x36\xf8\x32\xda\x98\xa1\xe9\xdb\x9a\xf5\x5c\xa8\x09\xfc\x60\x74\x03\xd6\x32\xb7\x47\x08\x96\xc1\x33\x34\xa3\x83\x16\x89\xb9\xd9\xd9\x1a\x9f\x63\x0f\xca\x59\x94\x36\x70\x4b\xe3\x02\x63\x92\x80\x0c\xf8\x87\xfa\xd2\x0e\x69\x0c\x60\x14\x02\x71\x33\x1a\x03\xca\x11\x4e\x32\x66\x45\xdf\xde\xa4\xf7\x1e\xd2\xe6\x34\x33\x81\x31\xda\x74\xda\xf4\xdc\xd5\x6c\xaf\x8f\x1e\x96\xb1\x10\x81\x7a\x68\x74\x3f\x08\x19\xd9\xa7\x47\x37\x8c\x6e\x52\x9a\x76\xde\x63\x05\x4b\x65\x8d\x3c\xc0\xd4\xd8\x6f\xc1\x14\x2c\xed\x6b\xaf\xe2\xe1\xc8\x8d\x12\x6a\xc7\x7a\xb0\x96\xef\x48\xb7\xb6\x48\x6d\x1d\x46\xe2\xe3\x23\x7a\x4d\xd8\xc9\x0f\xc2\x32\x3b\x0e\x98\x4a\xd0\x32\x6d\xd8\xa8\xa2\x57\x35\x69\xd6\x03\x26\x00\x97\x08\x99\xf7\x05\x6b\xa1\xe3\xa3\x74\x35\xfb\xfc\x15\x49\x8e\x7b\xe1\x00\x35\xd4\xcc\xee\xf5\x28\x5b\x32\xea\xe3\xa3\xd7\xba\x05\xc6\xd9\x56\xf2\xe6\x89\x5e\xb3\x56\x63\x22\x61\x79\xc5\x01\xa1\xc0\xef\xc1\x22\x9f\xcd\x09\xb6\x61\x7c\x11\xcd\x32\xad\xe4\xe9\xd7\xb9\x5e\x85\xdb\x71\x69\x81\x65\x01\xe4\x8c\x89\x18\x5b\xdd\x73\xd7\xec\x57\x26\xcc\xf9\xb9\x05\x46\x0a\x07\x03\xe8\x19\x4e\x85\x34\x72\x36\x70\xe7\xc0\x28\x8c\x26\x71\x53\x15\xa1\x34\xe4\xe6\x8d\x1b\xc3\x2e\x81\x42\x0a\xb4\x28\x12\x1e\x4c\x20\xb3\x78\xe3\xc4\x81\x3b\x60\x9a\x2a\x10\x9e\x79\xe3\xbc\xc4\xef\xb5\xc9\xc0\x3f\x47\x61\x20\x66\xcd\xef\xa6\xd2\x65\x3d\x7f\x82\x77\xa4\x2f\xc3\x8c\x2c\x22\x50\x4d\xdf\x16\x54\x34\x45\x9c\xa4\x05\xd3\xb6\x58\xbc\x5f\x4c\xee\xc9\xef\x10\x8c\xe8\xa6\x1d\xe6\x33\x8a\xfb\xca\x36\x1b\xa6\x84\x44\xb3\x14\x11\xe0\xdf\x19\x05\xee\x44\x57\x3f\x55\xb3\x97\x37\x33\xac\x1b\x94\x4d\xdf\xb2\x0d\x22\xbe\xf1\x1d\xcd\x60\x1b\xb2\xe6\x06\x45\x64\x22\xdb\xc4\x06\xdf\xa0\xd7\x28\x4f\x5b\x0c\xdd\x4d\xfc\x4b\x8e\x6e\xa2\x7c\xd5\xc6\x87\xe6\x06\x53\xf0\x27\xdb\x4c\x9e\x5d\x33\x80\x6a\xef\xf0\x7f\x09\xa1\x81\x5e\x1f\xe2\x20\xfa\x50\x9c\x7b\x59\x09\x79\xc6\x88\x5b\x74\x16\x88\xe9\x70\x68\xe1\xa0\x46\x3a\x8f\x92\x87\x16\x0e\x0f\xf8\x92\x4c\x71\x0d\x67\x5c\xf5\xe7\x8f\x1f\x1f\x31\xac\xc9\x51\xa8\x56\x1f\x6d\xb2\x0e\x6e\x24\xe3\xc3\xdf\xde\x25\x33\x66\x9a\x44\xd9\x96\xec\x9a\x26\x29\x58\x42\x0f\x3f\x7f\x49\xca\xce\x9e\x94\xe3\xcf\x25\xe6\x3e\x7e\x28\xff\xce\xa5\xf4\x13\x78\x76\x86\xe3\x34\xed\x92\x6f\x34\xd4\xa9\xac\xd3\xf6\xbe\xae\xee\x6b\x96\xf6\x49\x7e\x53\xc5\xfd\xfd\x2b\x4a\x92\xd2\xba\x76\xd3\xdc\xdf\xff\xf6\xf7\xff\xbb\xc6\xb6\x6f\x91\xc1\x3f\x68\xfe\x92\x94\x8d\x96\xda\x6c\x74\xd7\x91\x58\x5d\xd2\x70\xf4\x4f\x41\x43\xb3\xd2\x92\x66\xa9\x4c\xf3\x57\xcc\xd2\xdb\x51\x48\xd2\xb1\xd3\xf3\xf3\x25\x99\x57\x4b\x7c\x0f\x81\x58\x80\xdf\x12\x86\x89\x12\xcb\x0a\xef\x2f\x97\x66\x5f\x97\xf0\x0b\x3f\x70\x32\x00\x27\xd3\x18\x5c\x4d\x70\xd2\xf6\xc2\x89\xbe\xc0\x6e\x09\xb4\xfb\x00\x09\x25\xd9\xc6\x88\xc1\xbf\x4d\xeb\x31\x34\x7f\xdc\xa5\xb2\xa8\xee\x8b\xeb\xe2\xa4\x70\x60\xb8\x03\x14\x71\x36\x0f\xf1\xb9\x8c\x71\x8f\x5f\xbe\x15\xbe\xee\x0a\xe6\xcc\x08\x57\x04\x8f\x9c\x7a\x13\x12\x36\xf2\x30\x4c\x4b\x2f\x49\x59\x2a\xed\x83\x7f\x35\x89\xae\xa3\x55\x02\x75\xaf\x87\x97\x64\xd6\x53\x96\xb8\x87\xfc\x34\x4a\xf9\x57\xee\xf6\xd6\x2f\x59\xd7\xea\xd1\xf9\x39\xba\xc8\xd6\x21\xd9\x66\x9d\x55\x2a\x0b\x96\xb6\xf7\xd5\x75\xa5\x8d\xe4\x6a\x87\x0c\x7a\xfb\x0b\xe0\x89\x03\xde\x29\xcf\x8d\x19\x95\x07\x30\x51\xfc\x9f\x4b\x74\x38\x75\x92\x3f\x01\x19\x32\x9c\xdc\x5e\x2b\x3f\x9b\x57\xcf\xd2\xb0\x2a\xeb\x3f\x5c\x97\xd4\x9f\x86\xd3\x5a\x4a\x58\x39\x93\x70\x0b\xc7\x54\x06\x31\x8a\xb9\x14\xca\xd2\x77\x5c\xa5\x3f\x13\x36\xd4\xa1\xf1\xad\x04\xef\x74\x03\xd8\x19\xd9\x8d\xd2\x97\x99\x7e\x55\x9d\xdd\x77\x3d\x69\xf3\xad\x3e\x4d\xfc\xca\x77\x97\x9d\x3d\x0a\xd7\x51\x94\xec\x51\x74\x6e\x1d\x2e\x5a\xba\x92\xd7\x4b\x28\x90\xaa\xe5\xe6\x28\x14\x7e\xbf\x9e\xe0\x67\x2a\x9a\xeb\xf0\x22\x81\x52\xa8\xf1\xf9\xb6\xbc\x13\xef\xc9\xd6\x78\x8c\x5c\xec\x7d\x4b\x9e\xe7\xc6\x4e\xde\xbd\xa2\xcf\x3b\x84\xc4\xfb\xfb\x4d\xf5\x9e\x3f\xc1\x5b\xdd\xf7\x5c\xb5\x58\xf0\x3e\x92\xfe\x04\xac\x70\x78\x4b\x7b\x71\x20\xfe\xa0\xdf\xea\x7e\x90\xe0\x20\x3f\x3b\x11\x03\x69\xb6\x1d\x3c\xf8\xed\x50\x3f\xf2\x03\x84\x43\xd2\x8c\x2a\x58\xb2\x1d\xaa\x3f\x8e\xdd\x39\x77\xa3\x95\xe3\x42\xd9\xcc\x37\x46\x20\x01\x2f\x1a\x9e\x17\xfb\xd1\xa7\x82\x1d\x98\x50\x6c\xe0\xc2\x78\xa2\x9c\xb5\x7a\x3e\x39\x45\xc7\x0e\x78\xb0\x06\xbe\xf5\xb1\x4a\xfa\xc1\x8d\xd8\x52\x9a\x71\xe9\x1d\x10\x41\x3c\x06\x1a\xdf\x2f\x9c\xf5\x09\x0b\x7c\xc4\xbe\x1c\xfb\x1d\xf6\x27\xdb\xb1\xab\x7f\x12\x12\x3e\x9d\x06\x58\x35\x05\x74\xc5\xa1\xef\x15\x6e\x39\x71\xbb\x20\x4c\xe8\xcc\xf0\x4e\x5b\xfd\x49\x98\x0c\x5f\x42\x64\xae\x59\x4c\x1d\xc9\xca\xe8\x09\xc1\xd4\xf3\x20\x96\x0d\x3b\x54\x17\xfd\x1e\x7a\x67\xee\x8d\x2e\x5c\xb3\x08\xb0\xce\x08\xb5\xab\xe8\x35\xeb\x5c\x11\xc9\xca\x57\x5e\x3b\x83\xb0\xe7\x16\xfb\x9a\x25\x88\x87\x0a\x1b\xdd\xb8\xeb\xc9\x63\x30\x78\x53\xf1\x3c\x5c\xb5\xec\x10\xf5\x7a\xaf\x80\x5b\xf7\x7d\x53\xcc\x82\xc4\x45\x1a\xca\xfe\xaf\x25\xce\x2f\x21\x00\xdc\xec\x96\x10\x1c\xa8\x13\x5e\x45\x00\xff\xfc\xf2\xe7\xa7\xaf\xbe\x47\xae\x77\x76\xdc\x66\x49\x9a\xe2\x21\x42\x21\x9d\x57\xb0\x8c\x5a\x61\x6e\xb8\x52\x74\x33\xb4\x0b\xcc\x18\x7d\xcc\xbc\x82\xb2\xa2\xa2\xdb\x85\xd7\x8b\x63\xd4\x70\xe7\x57\x93\x7b\x9d\xcb\x5a\x51\x5d\x4e\x75\x7a\x59\x99\xbf\x52\x0b\x0b\x18\x9f\x94\xb7\x6e\x3b\x61\x1b\x18\xbb\xfa\xad\x04\x6e\xde\xfb\xbb\xb3\xcd\xc2\xde\x32\xed\x42\xb4\x8b\x57\x7f\xd1\xdb\xc7\x81\x1f\x55\x16\xc9\x4a\x92\xf0\x1f\x36\x23\xad\x7e\x7c\xa6\xbe\x63\xa5\x7c\xa5\xf1\xdc\x52\x64\xc8\xfc\xf1\xf3\x1a\xdb\x92\xca\xd8\x11\xe1\xed\xc4\x0e\x32\xe2\x4c\xbe\xa8\x09\x6e\xf8\x19\x0b\x76\xf0\xbc\xbe\xeb\xac\x02\x9f\x64\x55\x55\xe6\xc9\x12\x7b\xda\xb3\xb3\xb4\xbd\x8f\x17\x7b\x4f\x89\x6b\x73\xd9\xff\xa3\xa0\xa6\x4c\x28\x26\xe6\xca\x87\x75\xd6\x95\x25\xfb\x64\x44\xef\xaf\x45\x76\xe0\xcd\xea\x3a\x84\x1b\x0e\x0e\xb5\x2f\xe3\xe4\xe7\xd4\xbe\x41\x1d\xa9\x7d\xf3\x9b\x64\x55\x86\xa1\xdc\x3b\xa1\x5a\xd2\x52\x78\xb3\xf2\x2b\xf9\x37\xef\x66\xe4\x40\x28\x58\x6f\x77\xe7\x1b\x46\x2c\x62\xc5\x2d\x3a\xb6\xe5\x16\xf0\x32\x95\x4d\x5b\x61\x8e\x5b\xd5\xbc\x4a\x75\x72\xa9\x76\x51\xbd\xf5\xfa\xfc\xef\x76\xd5\x07\x38\x86\x6c\xfa\xc1\xbd\x13\x0a\xe6\x94\x22\x5c\x05\x73\xda\xff\x84\x43\x90\xf2\x62\x62\x7b\xff\xe9\x47\x0c\x57\x7e\xa1\x03\x73\xf4\x87\xb6\x0d\x32\x33\x54\xb6\x26\x8a\x77\x9b\xdb\x85\xe5\x73\xc6\x3a\x53\x30\x0b\x43\xbe\x4a\x17\x3b\x4a\xb7\x5c\xd7\xd7\x49\x94\x25\xd9\xe7\x9f\x53\xfb\x95\x72\xc3\x27\x53\x36\x0b\xc0\x9c\x00\xde\xec\x31\x23\xac\x33\xf5\xce\x3b\x3b\x44\x2a\xca\x0a\x87\x87\x7e\x25\x94\x05\xe3\x32\xaf\xb0\x20\xce\xfc\xda\x21\xe7\x09\xce\x0c\x58\xc7\x23\x42\x6a\x61\xa0\x8b\xed\x7f\x7a\xa1\x0d\x7c\x5f\xbe\x24\x2b\x0c\x5e\x28\xfd\x8e\x39\xe7\x10\xd5\x84\xcf\xb0\x24\xab\xde\x24\xac\xaa\x88\xbd\xaa\x58\x92\x67\xd5\x9b\x9c\xfa\x99\xdf\x25\xab\xed\x89\x7e\x08\x44\xa9\xff\x0e\x00\x00\xff\xff\xb6\x46\x5d\xee\x5d\x16\x00\x00" +var _runtimePluginsLinterLinterLua = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x18\x69\x8f\xa4\xb8\xf5\x7b\xff\x8a\x27\x14\x24\x98\x06\x5a\x89\xf2\x09\xa9\x14\x6d\x26\xbb\x91\xa2\x39\x22\xf5\x44\xf9\x30\x33\x1b\xb9\xe0\x51\xe5\x6d\x63\x13\xdb\x54\x75\xa5\x35\xff\x3d\x7a\xb6\x01\x53\x47\xef\xe4\x28\xa9\xf0\xc1\xbb\x2f\x3f\x23\x54\xc3\x04\xe8\x51\x5a\xde\x23\x6c\x80\xf7\x83\xd2\x36\x4b\xc2\x4e\x92\xdf\x79\x88\x8e\x0b\x1c\x98\xdd\x47\x20\xb4\x7c\x98\xf6\x67\x40\xb3\x47\x21\x22\xa8\x9e\x37\x5a\x3d\xb8\xdd\x19\x66\x3b\x76\x1d\xea\x0b\x20\xbf\x3d\x43\x35\x4a\x76\x7c\x77\x01\xe5\xb7\x93\xfc\x2e\x80\x09\x2e\x2d\x6a\x03\x1b\x78\xf9\x76\x77\x57\x96\xd0\x68\x64\x16\x0d\xb0\xf0\x0a\x50\x5a\x7d\x2a\xa0\x61\x42\x40\xa7\x55\x0f\x47\x6e\xf7\x5c\x02\x93\xc0\x25\xb7\x9c\x09\xfe\x2f\x66\xb9\x92\xd0\x8d\xb2\xa1\x49\x01\x52\x59\xa2\xd5\x72\x8d\x8d\x15\x27\x60\x76\x82\x05\xa1\x58\x0b\x64\x9c\xbb\xb2\x24\x18\xc9\x7a\xac\xdd\x13\x54\x07\x76\x8f\x81\x2f\xbd\x23\xf3\xd8\xd3\x80\xf5\x3c\x03\xab\xa0\xd9\x63\xf3\x04\x9d\xd2\xb4\x18\x4d\x8c\xd0\xf4\x6d\x0d\x3d\xe3\x72\x12\x7e\xd0\xaa\x41\x63\xc0\xee\x49\x04\x03\xf8\x8c\xcd\x68\xb1\x25\x60\xa6\x77\xa6\xa6\xe7\xd8\xa3\xb4\x86\xa8\x0d\xcc\xb8\x71\x11\x63\xa2\x40\x08\xf4\x23\x7e\x69\x47\x30\x1a\xc9\x0b\x01\xb8\x19\xb5\x46\x69\x9d\x9c\x4e\x99\x15\x7c\x7b\x13\xde\x5b\x48\xe9\xd3\x8c\x84\x5a\x2b\xdd\x29\xdd\x33\x5b\xc3\x5e\x1d\xbd\x58\xda\x60\x24\xd4\x43\xa3\xfa\x81\x8b\x48\x3f\x35\xda\x61\xb4\x13\xd3\xb4\xf3\x16\x2b\x20\x15\x35\xe1\x20\xc8\xb1\xdf\xa2\x2e\x20\xed\x6b\xcf\xe2\xe1\xc8\xb4\xe4\x72\x07\x3d\x1a\xc3\x76\x8e\xb7\x32\x04\x6d\x2c\x79\xe2\xe3\x23\x59\x8d\x9b\xc9\x0e\xdc\x80\x19\x07\x0a\x25\x6c\x41\x69\x18\x65\xb4\x94\x13\x67\x35\x50\x00\x30\x41\x22\xb3\xbe\x80\x16\x3b\x36\x0a\x5b\xc3\xe7\xaf\x04\x72\xdc\x73\x8b\xc4\xa1\x06\xb3\x57\xa3\x68\x9d\x52\x1f\x1f\x3d\xd7\x2d\x02\x83\xad\x60\xcd\x93\x5b\x66\xad\xa2\x40\xa2\xf4\x8a\x1d\xe2\x1c\xbf\x47\x43\x78\x26\x77\x62\x6b\x60\x0b\x69\xc8\x94\x14\xa7\x5f\xc7\x7a\x55\xdc\x8e\x09\x83\x90\x05\x21\x67\x99\x1c\x62\xab\x7a\x66\x9b\xfd\x4a\x85\x39\x3e\xb7\x08\x8e\xe1\xa0\x91\x2c\xc3\x5c\x22\x8d\x0c\x06\x66\x2d\x6a\x49\xde\x74\xd8\x2e\x8b\x88\x1a\x61\xb3\xc6\x8e\xa1\x4a\x10\x91\x82\x34\x8a\x88\x07\x15\x9c\x5a\xac\xb1\xfc\xc0\x2c\x82\x72\x19\x88\xcf\xac\xb1\x9e\xe2\xf7\xea\xa4\xf1\x9f\x23\xd7\x18\xa3\xe6\x77\x53\xea\x42\xcf\x9e\xf0\x9d\xe3\x97\x51\x44\x16\x91\x50\x4d\xdf\x16\x2e\x69\x8a\x38\x48\x0b\x50\xa6\x58\xac\x5f\x4c\xe6\xc9\xef\x48\x18\xde\x4d\x15\xe6\x33\x91\xfb\x0a\x9b\x0d\x48\x2e\x48\x2d\xe9\x00\xe8\x77\x06\x41\x95\xe8\xea\xab\x6a\xb6\xf2\x66\x16\xeb\x06\x64\xd3\xb7\xb0\x21\x89\x6f\xbc\x27\x35\x60\xe3\xb4\xb9\x01\x11\xa9\x08\x9b\x58\xe1\x1b\xf0\x8a\xe8\x29\x43\xae\xbb\x29\xff\x12\xa3\x9b\x28\x5e\x95\xf6\xae\xb9\x81\x14\xec\x09\x9b\xc9\xb2\x6b\x04\x94\xed\x1d\xfd\x17\x17\x6a\xec\xd5\x21\x76\xa2\x77\xc5\xb9\x95\x25\x17\x67\x88\x54\xa2\xb3\x00\xec\x0e\x87\x16\x0f\x72\x74\xe7\x51\xf2\xd0\xe2\xe1\x81\x16\xc9\xe4\xd7\x70\xc6\x55\x7f\xfe\xf8\xf1\x91\xdc\x9a\x1c\xb9\x6c\xd5\xd1\x24\x6b\xe7\x46\x34\x3e\xfc\xed\x5d\x32\xcb\xec\x26\x51\xb4\x25\xbb\xa6\x49\x0a\x48\xdc\xc3\xcf\x5f\x92\xb2\x33\x27\x69\xd9\x73\x49\xb1\x4f\x2f\xca\xbf\x33\x21\xfc\x04\x9f\xad\x66\x34\x4d\xbb\xe4\x9b\x1b\xea\x54\xd4\x69\x7b\x5f\x57\xf7\x35\xa4\x7d\x92\xdf\x64\x71\x7f\xff\x0a\x93\xa4\x34\xb6\xdd\x34\xf7\xf7\xbf\xfd\xfd\xff\xce\xb1\xed\x5b\x42\xf0\x0f\x37\x7f\x49\xca\x46\x09\xa5\x37\xaa\xeb\x1c\x59\x55\xba\xe1\xe8\x9f\xdc\x0d\xcd\x8a\x4b\x9a\xa5\x22\xcd\x5f\x51\x4b\x6d\x47\x2e\x1c\x8f\x9d\x9a\x9f\x2f\xc9\xbc\x5b\xd2\x3a\x38\x62\x11\xfc\x16\x31\x0a\x94\x98\x56\x58\xbf\x5c\xaa\x7d\x9d\xc2\x2f\xec\xc0\x9c\x02\x34\x99\xc6\x60\x6a\x27\x4e\xda\x5e\x18\xd1\x27\xd8\x2d\x82\x66\x1f\x44\x22\x4a\xa6\xd1\x7c\xf0\xab\x69\x3f\x16\xcd\x1f\x77\xa9\x28\xaa\xfb\xe2\x3a\x39\xc1\x2d\x6a\x66\x91\x48\x9c\xcd\x83\x7f\x2e\x7d\xdc\xd3\x9b\x6f\x85\xcf\xbb\x02\xac\x1e\xf1\x0a\xe1\x91\xb9\xde\xc4\x11\x1b\x59\x18\xa6\xad\x97\xa4\x2c\xa5\xf2\xce\xbf\x1a\x44\xd7\xa5\x95\x9c\x78\xaf\x87\x97\x64\xe6\x53\x96\x54\x43\x7e\x1a\x85\xf8\x2b\xb3\x7b\xe3\xb7\x8c\x6d\xd5\x68\xfd\x9c\x4c\x64\xea\x10\x6c\x33\xcf\x2a\x15\x05\xa4\xed\x7d\x75\x9d\x69\x23\x98\xdc\x11\x82\xda\xfe\x82\x74\xe2\xa0\x37\xca\x73\xa3\x47\xe9\x05\x98\x20\xfe\xcf\x29\x3a\x9c\x3a\xc1\x9e\xd0\x29\x32\x9c\xec\x5e\x49\x3f\x9b\x77\xcf\xc2\xb0\x2a\xeb\x3f\x5c\xa7\xd4\x9f\x86\xd3\x9a\x4a\xd8\x39\xa3\x70\x4b\x8e\x29\x0d\x62\x29\xe6\x54\x28\x4b\xdf\x71\x95\xfe\x4c\xd8\xb8\x0e\x8d\x6d\x05\x7a\xa3\x6b\xa4\xce\xc8\x6c\xa4\xba\x8c\xf4\xab\xec\xcc\xbe\xeb\x1d\x37\xdf\xea\xbb\x89\xdf\xf9\xee\xb4\x33\x47\x6e\x3b\xe7\x25\x73\xe4\x9d\x5d\xbb\xcb\x6d\x5d\x89\xeb\xc5\x15\x04\xd5\x32\x7d\xe4\x92\xde\x5f\x0f\xf0\x33\x16\xcd\x75\xf1\x22\x82\x82\xcb\xf1\xf9\x36\xbd\x13\xeb\x9d\xae\xf1\x18\x99\xd8\xdb\xd6\x59\x9e\x69\x33\x59\xf7\x0a\x3f\x6f\x10\x47\xde\xdf\x6f\xaa\xf7\xec\x09\xdf\xaa\xbe\x67\xb2\xa5\x84\xf7\x9e\xf4\x27\x60\x45\xc3\x5b\x57\x8b\x03\xf0\x07\xf5\x56\xf5\x83\x40\x8b\xf9\xd9\x89\x18\x40\xb3\xed\xe0\x85\xdf\x0e\xf5\x23\x3b\x60\x38\x24\xf5\x28\x83\x26\xdb\xa1\xfa\xe3\xd8\x9d\x63\x37\x4a\x5a\xc6\xa5\xc9\x7c\x63\x84\x02\xe9\xa2\xe1\x71\xa9\x1f\x7d\x2a\xe0\x00\x5c\xc2\xc0\xb8\xf6\x40\x39\xb4\x6a\x3e\x39\x79\x07\x07\x3a\x58\x03\xde\xfa\x58\x75\xfc\xd1\x8e\xd4\x52\xea\x71\xe9\x1d\x48\x82\x78\x0c\x30\xbe\x5f\x38\xeb\x13\x16\xf1\x49\xf6\xe5\xd8\xef\xa8\x3f\xd9\x8e\x5d\xfd\x13\x17\xf8\xe9\x34\xe0\xaa\x29\x70\x57\x1c\xf7\xbe\xa2\x92\x13\xb7\x0b\x5c\x87\xce\x8c\xee\xb4\xd5\x9f\xb8\xce\x68\x11\x3c\x73\x4d\x63\xd7\x91\xac\x94\x9e\x24\x98\x7a\x1e\x92\x65\x03\x87\xea\xa2\xdf\x23\xeb\xcc\xbd\xd1\x85\x69\x16\x02\xc6\x6a\x2e\x77\x95\x5b\x66\x9d\x2d\x22\x5a\xf9\xca\x6a\x67\x22\xec\x99\xa1\xbe\x66\x71\xe2\xa1\xa2\x46\x37\xee\x7a\xf2\x58\x18\xba\xa9\x78\x1c\x26\x5b\x38\x44\xbd\xde\x2b\xc2\xad\xfb\xbe\xc9\x67\x81\xe2\x42\x8d\x68\xff\xd7\x14\xcf\xf4\x0a\x9d\x6f\xd4\xa3\x06\xc7\x30\xbd\x5b\x5c\x73\x70\x1d\xf2\xca\x33\xf4\xa3\xcd\xcf\x4f\x5f\x7d\xe7\x5c\xef\xcc\xb8\xcd\x92\x34\xa5\xa3\xc5\x39\x7a\xde\xa1\xe4\x6a\xb9\xbe\x61\x60\xde\xcd\x02\x5f\x68\x42\x31\x41\xf1\x58\xb8\x58\xa9\xa2\x3b\xc7\x21\x6e\xc9\xf3\xab\x01\xbf\x8e\x6f\x25\x5d\xae\x4e\xb9\x7b\x99\xad\xbf\x92\x1f\x8b\x28\x3e\x50\x6f\xdd\x80\x42\x69\x18\xbb\xfa\xad\x40\xa6\xdf\xfb\xfb\xb4\xc9\x42\xbd\x99\x2a\x93\xab\xec\xd5\x5f\xd4\xf6\x71\x60\x47\x99\x45\xb4\x92\x24\xfc\x43\x81\x52\xf2\xc7\x67\xd7\x8b\xac\x98\xaf\x38\x9e\x6b\x4a\x08\x99\x3f\x92\x5e\x43\x5b\xc2\x80\xba\x24\x8a\x03\x33\x88\x08\x33\xf9\x22\x27\x71\xc3\xa7\x2d\xdc\xe1\xf3\xfa\xfe\xb3\x72\x7b\x92\x55\x55\x99\x27\x8b\xe7\x5d\x1d\xcf\xd2\xf6\x3e\xde\xec\x3d\x24\xed\xcd\xa5\xe0\x1f\x85\x6b\xd4\xb8\x04\x3e\x57\x03\x5c\x47\x5c\x59\xc2\x27\xcd\x7b\x7f\x55\x32\x03\x6b\x56\x57\x24\x2a\x42\x34\xd4\x3e\xb5\x93\x9f\x53\xf3\x86\x78\xa4\xe6\xcd\x6f\x92\x55\x6a\x86\x12\xd0\x71\xd9\x3a\x2e\x85\x57\x2b\xbf\x12\x7d\x73\x85\x73\x06\xc4\x02\x7a\xb3\x3b\x2f\x22\x31\x89\x15\x36\xef\x60\xcb\x0c\xd2\x05\x2b\x9b\xca\x63\x4e\xe5\x6b\xde\x75\x59\x72\xc9\x76\x61\xbd\xf5\xfc\xfc\xb7\xbc\xea\x03\x1e\x43\x34\xfd\x60\xdf\x71\x89\x73\x48\x39\xb9\x0a\xb0\xca\x7f\xd6\x71\x22\xe5\xc5\x84\xf6\xfe\xd3\x8f\xe4\xae\xfc\x82\x07\xc5\xe8\x0f\x6d\x1b\x68\x66\xc4\x6c\x0d\x14\x57\xa0\xdb\x89\xe5\x63\xc6\x58\x5d\x80\xc1\x21\x5f\x85\x8b\x19\x85\x5d\xca\xcb\x3a\x88\xb2\x24\xfb\xfc\x73\x6a\xbe\xba\xd8\xf0\xc1\x94\xcd\x04\x28\x26\x90\x35\x7b\x8a\x08\x63\x75\xbd\xf3\xc6\x0e\x9e\x8a\xa2\xc2\x52\x23\x50\x71\x69\x50\xdb\xcc\x33\x2c\x1c\x66\x7e\xed\xe0\xf3\x00\x67\x0a\xac\xfd\x11\x49\x6a\x70\x70\x97\xdd\xff\xf4\x92\x1b\xf0\xbe\x7c\x49\x56\x32\x78\xa2\xee\xdb\xe6\x1c\x43\x2e\x27\x7c\x84\x25\x59\xf5\x26\x81\xaa\x72\xe8\x55\x05\x49\x9e\x55\x6f\x72\xd7\xe3\xfc\x2e\x59\x95\x27\xf7\x71\x90\xa8\xfe\x3b\x00\x00\xff\xff\x62\x4a\x34\x00\x71\x16\x00\x00" func runtimePluginsLinterLinterLuaBytes() ([]byte, error) { return bindataRead( diff --git a/internal/display/bufwindow.go b/internal/display/bufwindow.go index 85719689..391e0010 100644 --- a/internal/display/bufwindow.go +++ b/internal/display/bufwindow.go @@ -67,6 +67,10 @@ func (w *BufWindow) SetActive(b bool) { w.active = b } +func (w *BufWindow) IsActive() bool { + return w.active +} + func (w *BufWindow) getStartInfo(n, lineN int) ([]byte, int, int, *tcell.Style) { tabsize := util.IntOpt(w.Buf.Settings["tabsize"]) width := 0 diff --git a/internal/display/infowindow.go b/internal/display/infowindow.go index a2b72945..db2f9c08 100644 --- a/internal/display/infowindow.go +++ b/internal/display/infowindow.go @@ -63,6 +63,7 @@ func (i *InfoWindow) Relocate() bool { return false } func (i *InfoWindow) GetView() *View { return i.View } func (i *InfoWindow) SetView(v *View) {} func (i *InfoWindow) SetActive(b bool) {} +func (i *InfoWindow) IsActive() bool { return true } func (i *InfoWindow) GetMouseLoc(vloc buffer.Loc) buffer.Loc { c := i.Buffer.GetActiveCursor() diff --git a/internal/display/termwindow.go b/internal/display/termwindow.go index 45150948..d195d532 100644 --- a/internal/display/termwindow.go +++ b/internal/display/termwindow.go @@ -40,6 +40,10 @@ func (w *TermWindow) SetActive(b bool) { w.active = b } +func (w *TermWindow) IsActive() bool { + return w.active +} + func (w *TermWindow) GetMouseLoc(vloc buffer.Loc) buffer.Loc { return vloc } diff --git a/internal/display/window.go b/internal/display/window.go index d2d4742a..4e39bdbd 100644 --- a/internal/display/window.go +++ b/internal/display/window.go @@ -23,6 +23,7 @@ type Window interface { GetMouseLoc(vloc buffer.Loc) buffer.Loc Resize(w, h int) SetActive(b bool) + IsActive() bool } type BWindow interface { diff --git a/runtime/plugins/linter/linter.lua b/runtime/plugins/linter/linter.lua index f7c093e9..a4cac3f0 100644 --- a/runtime/plugins/linter/linter.lua +++ b/runtime/plugins/linter/linter.lua @@ -103,12 +103,13 @@ function runLinter(buf) ftmatch = false end + local args = {} for k, arg in pairs(v.args) do - v.args[k] = arg:gsub("%%f", file):gsub("%%d", dir) + args[k] = arg:gsub("%%f", file):gsub("%%d", dir) end if ftmatch then - lint(buf, k, v.cmd, v.args, v.errorformat) + lint(buf, k, v.cmd, args, v.errorformat) end end end