]> git.lizzy.rs Git - micro.git/commitdiff
Switch to gdamore/tcell
authorZachary Yedidia <zyedidia@gmail.com>
Tue, 31 Dec 2019 22:23:12 +0000 (17:23 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Tue, 31 Dec 2019 22:53:16 +0000 (17:53 -0500)
18 files changed:
cmd/micro/micro.go
go.mod
go.sum
internal/action/actions.go
internal/action/bindings.go
internal/action/bufpane.go
internal/action/events.go
internal/action/infopane.go
internal/action/rawpane.go
internal/action/tab.go
internal/action/termpane.go
internal/buffer/message.go
internal/config/colorscheme.go
internal/config/colorscheme_test.go
internal/display/bufwindow.go
internal/display/infowindow.go
internal/display/termwindow.go
internal/screen/screen.go

index 1b28bde2a030fcd24533058fe2bbcb8b4ddb7b7d..4bc638b49f3eb4b2ef6da67bfff47f161f5063ee 100644 (file)
@@ -7,6 +7,7 @@ import (
        "os"
        "sort"
 
+       "github.com/gdamore/tcell"
        "github.com/go-errors/errors"
        isatty "github.com/mattn/go-isatty"
        "github.com/zyedidia/micro/internal/action"
@@ -15,7 +16,6 @@ import (
        "github.com/zyedidia/micro/internal/screen"
        "github.com/zyedidia/micro/internal/shell"
        "github.com/zyedidia/micro/internal/util"
-       "github.com/zyedidia/tcell"
 )
 
 var (
diff --git a/go.mod b/go.mod
index 8d1b4fa9931df3b499d7814ef924a770d046664d..bb5e1dd57c8b31e92a732cc03bbb291fb7b40ed8 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ require (
        github.com/blang/semver v3.5.1+incompatible
        github.com/dustin/go-humanize v1.0.0
        github.com/flynn/json5 v0.0.0-20160717195620-7620272ed633
-       github.com/gdamore/encoding v1.0.0 // indirect
+       github.com/gdamore/tcell v1.3.0
        github.com/go-errors/errors v1.0.1
        github.com/lucasb-eyer/go-colorful v1.0.3 // indirect
        github.com/mattn/go-isatty v0.0.11
diff --git a/go.sum b/go.sum
index f8a69fceec1db4b4560ddcc30f6208748a186a04..bac7a50bde1dc464730a1b981a6946f822b933c3 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -1,3 +1,4 @@
+github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
 github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
 github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
 github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
@@ -11,15 +12,19 @@ github.com/flynn/json5 v0.0.0-20160717195620-7620272ed633 h1:xJMmr4GMYIbALX5edyo
 github.com/flynn/json5 v0.0.0-20160717195620-7620272ed633/go.mod h1:NJDK3/o7abx6PP54EOe0G0n0RLmhCo9xv61gUYpI0EY=
 github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
 github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
+github.com/gdamore/tcell v1.3.0 h1:r35w0JBADPZCVQijYebl6YMWWtHRqVEGt7kL2eBADRM=
+github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM=
 github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
 github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s=
 github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac=
 github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
 github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
 github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
+github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
 github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
 github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
 github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
@@ -53,6 +58,7 @@ github.com/zyedidia/tcell v0.0.0-20191228235154-5b9bbc0d56c7/go.mod h1:yXgdp23+a
 github.com/zyedidia/terminal v0.0.0-20180726154117-533c623e2415 h1:752dTQ5OatJ9M5ULK2+9lor+nzyZz+LYDo3WGngg3Rc=
 github.com/zyedidia/terminal v0.0.0-20180726154117-533c623e2415/go.mod h1:8leT8G0Cm8NoJHdrrKHyR9MirWoF4YW7pZh06B6H+1E=
 golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
 golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
index 925c97e8b97d2a20feae8f1697490a97127ae56f..6e871cd988620ec92136d4b00fd4156776dc67b7 100644 (file)
@@ -14,7 +14,7 @@ import (
        "github.com/zyedidia/micro/internal/shell"
        "github.com/zyedidia/micro/internal/util"
        "github.com/zyedidia/micro/pkg/shellwords"
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
 )
 
 // ScrollUp is not an action
index 18fdfa338373b78789683b0372562eaa80f47e73..b2f2b02cb9ac464cb3bd8ab55873ccaa390739ad 100644 (file)
@@ -9,9 +9,9 @@ import (
        "unicode"
 
        "github.com/flynn/json5"
+       "github.com/gdamore/tcell"
        "github.com/zyedidia/micro/internal/config"
        "github.com/zyedidia/micro/internal/screen"
-       "github.com/zyedidia/tcell"
 )
 
 func InitBindings() {
@@ -374,8 +374,6 @@ var keyEvents = map[string]tcell.Key{
        "CtrlRightSq":    tcell.KeyCtrlRightSq,
        "CtrlCarat":      tcell.KeyCtrlCarat,
        "CtrlUnderscore": tcell.KeyCtrlUnderscore,
-       "CtrlPageUp":     tcell.KeyCtrlPgUp,
-       "CtrlPageDown":   tcell.KeyCtrlPgDn,
        "Tab":            tcell.KeyTab,
        "Esc":            tcell.KeyEsc,
        "Escape":         tcell.KeyEscape,
index f3a734daf848165c410cd3e3280d5acbe2b2701f..138cd3f283663d886c701e72ff4d44cb6701151a 100644 (file)
@@ -6,13 +6,13 @@ import (
 
        luar "layeh.com/gopher-luar"
 
+       "github.com/gdamore/tcell"
        lua "github.com/yuin/gopher-lua"
        "github.com/zyedidia/micro/internal/buffer"
        "github.com/zyedidia/micro/internal/config"
        "github.com/zyedidia/micro/internal/display"
        ulua "github.com/zyedidia/micro/internal/lua"
        "github.com/zyedidia/micro/internal/screen"
-       "github.com/zyedidia/tcell"
 )
 
 type BufKeyAction func(*BufPane) bool
@@ -261,14 +261,14 @@ func (h *BufPane) HandleEvent(event tcell.Event) {
        }
 
        switch e := event.(type) {
-       case *tcell.EventRaw:
-               re := RawEvent{
-                       esc: e.EscSeq(),
-               }
-               h.DoKeyEvent(re)
-       case *tcell.EventPaste:
-               h.paste(e.Text())
-               h.Relocate()
+       // case *tcell.EventRaw:
+       //      re := RawEvent{
+       //              esc: e.EscSeq(),
+       //      }
+       //      h.DoKeyEvent(re)
+       // case *tcell.EventPaste:
+       //      h.paste(e.Text())
+       //      h.Relocate()
        case *tcell.EventKey:
                ke := KeyEvent{
                        code: e.Key(),
index 5bf6c58ed90cf7f37f80d156d104636ee5d25fae..80596195bd7bcf39577c0c315af90eeda8b60f4d 100644 (file)
@@ -1,7 +1,7 @@
 package action
 
 import (
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
 )
 
 type Event interface{}
index 00dde63350ef86c692688f30076610103c7fa290..0ded6be27150d2b5aedbf9f98ed51a7712788700 100644 (file)
@@ -7,7 +7,7 @@ import (
        "github.com/zyedidia/micro/internal/display"
        "github.com/zyedidia/micro/internal/info"
        "github.com/zyedidia/micro/internal/util"
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
 )
 
 type InfoKeyAction func(*InfoPane)
index cdeade478cee53a3dc6192028f20e6965ea76530..b40db4af93f08178d16d3d47dbe3173fc97300fd 100644 (file)
@@ -1,12 +1,11 @@
 package action
 
 import (
-       "fmt"
        "reflect"
 
+       "github.com/gdamore/tcell"
        "github.com/zyedidia/micro/internal/buffer"
        "github.com/zyedidia/micro/internal/display"
-       "github.com/zyedidia/tcell"
 )
 
 type RawPane struct {
@@ -35,6 +34,7 @@ func (h *RawPane) HandleEvent(event tcell.Event) {
        }
 
        h.Buf.Insert(h.Cursor.Loc, reflect.TypeOf(event).String()[7:])
-       h.Buf.Insert(h.Cursor.Loc, fmt.Sprintf(": %q\n", event.EscSeq()))
+       // h.Buf.Insert(h.Cursor.Loc, fmt.Sprintf(": %q\n", event.EscSeq()))
+       h.Buf.Insert(h.Cursor.Loc, "\n")
        h.Relocate()
 }
index ba29a2821856845d76af973e0fe28c186a1bb869..f7ae111b3bfcdb92337a4f8db05c777f571296cb 100644 (file)
@@ -6,7 +6,7 @@ import (
        "github.com/zyedidia/micro/internal/display"
        "github.com/zyedidia/micro/internal/screen"
        "github.com/zyedidia/micro/internal/views"
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
 )
 
 // The TabList is a list of tabs and a window to display the tab bar
index b5a2da527f22ca4c3671312ef337688f10e1043f..bde15ae060a4483c63573ddc9cdf550a01925d21 100644 (file)
@@ -3,11 +3,11 @@ package action
 import (
        "runtime"
 
+       "github.com/gdamore/tcell"
        "github.com/zyedidia/clipboard"
        "github.com/zyedidia/micro/internal/display"
        "github.com/zyedidia/micro/internal/screen"
        "github.com/zyedidia/micro/internal/shell"
-       "github.com/zyedidia/tcell"
        "github.com/zyedidia/terminal"
 )
 
@@ -78,10 +78,10 @@ func (t *TermPane) HandleEvent(event tcell.Event) {
                        clipboard.WriteAll(t.GetSelection(t.GetView().Width), "clipboard")
                        InfoBar.Message("Copied selection to clipboard")
                } else if t.Status != shell.TTDone {
-                       t.WriteString(event.EscSeq())
+                       // t.WriteString(event.EscSeq())
                }
        } else if e, ok := event.(*tcell.EventMouse); e != nil && (!ok || t.State.Mode(terminal.ModeMouseMask)) {
-               t.WriteString(event.EscSeq())
+               // t.WriteString(event.EscSeq())
        } else if e != nil {
                x, y := e.Position()
                v := t.GetView()
index 065d96668e3adbb9b18362da76afaa01b784131c..b21dd42ff5cfbfccf7e2b003ae1b875f8748c1ef 100644 (file)
@@ -2,7 +2,7 @@ package buffer
 
 import (
        "github.com/zyedidia/micro/internal/config"
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
 )
 
 type MsgType int
index a843c4c61af5480baf961c84d2b377e653cb933e..8080d7fc89128847dd90728d264af737780f5eba 100644 (file)
@@ -6,7 +6,7 @@ import (
        "strconv"
        "strings"
 
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
 )
 
 // Micro's default style
index 83080df15ad8fce874600ce5db4d76e15f737915..494637c0c6635bcbf0295eff900259af74a27a08 100644 (file)
@@ -4,7 +4,7 @@ import (
        "testing"
 
        "github.com/stretchr/testify/assert"
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
 )
 
 func TestSimpleStringToStyle(t *testing.T) {
index 3993416626c21a6a266c1d78ac8c69626be0ee3d..04766d495e644e24bdcafe01ba6a37ed7f89129d 100644 (file)
@@ -10,7 +10,7 @@ import (
        "github.com/zyedidia/micro/internal/config"
        "github.com/zyedidia/micro/internal/screen"
        "github.com/zyedidia/micro/internal/util"
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
 )
 
 // The BufWindow provides a way of displaying a certain section
index b179c81e941978ca808573975866c81a9a8a13df..57a989253aa95749bb43acaa97bf781b0d148a1c 100644 (file)
@@ -9,7 +9,7 @@ import (
        "github.com/zyedidia/micro/internal/info"
        "github.com/zyedidia/micro/internal/screen"
        "github.com/zyedidia/micro/internal/util"
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
 )
 
 type InfoWindow struct {
index 95a9003764064f5aade804ebbcc2e202b0bb40e1..5b7797f836043c098f59d22646762857bc4a0570 100644 (file)
@@ -7,7 +7,7 @@ import (
        "github.com/zyedidia/micro/internal/config"
        "github.com/zyedidia/micro/internal/screen"
        "github.com/zyedidia/micro/internal/shell"
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
        "github.com/zyedidia/terminal"
 )
 
index 1e149be7201311af328f3922456dd50efb2ddaab..98af8803801833b20f5a5f4722e41c8aa7a5c344 100644 (file)
@@ -7,7 +7,7 @@ import (
 
        "github.com/zyedidia/micro/internal/config"
        "github.com/zyedidia/micro/pkg/terminfo"
-       "github.com/zyedidia/tcell"
+       "github.com/gdamore/tcell"
 )
 
 // Screen is the tcell screen we use to draw to the terminal