Skip to content

Commit

Permalink
chore: update deps and swap to fork of gocui
Browse files Browse the repository at this point in the history
  • Loading branch information
jbpratt committed Aug 14, 2020
1 parent 62808d1 commit 6ee59f2
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ before:
builds:
- env:
- CGO_ENABLED=0
ignore:
- goos: darwin
goarch: 386
archives:
- replacements:
darwin: Darwin
Expand Down
2 changes: 1 addition & 1 deletion chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sort"
"strings"

"github.com/jroimartin/gocui"
"github.com/awesome-gocui/gocui"
"github.com/voloshink/dggchat"
)

Expand Down
8 changes: 3 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
module github.com/MemeLabs/tsgg

go 1.12
go 1.15

require (
github.com/BurntSushi/toml v0.3.1
github.com/gorilla/websocket v1.4.0 // indirect
github.com/jroimartin/gocui v0.4.0
github.com/mattn/go-runewidth v0.0.4 // indirect
github.com/nsf/termbox-go v0.0.0-20190624072549-eeb6cd0a1762 // indirect
github.com/awesome-gocui/gocui v0.6.0
github.com/gorilla/websocket v1.4.2 // indirect
github.com/voloshink/dggchat v0.0.0-20171209033102-97642b4d160e
)
14 changes: 8 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/jroimartin/gocui v0.4.0 h1:52jnalstgmc25FmtGcWqa0tcbMEWS6RpFLsOIO+I+E8=
github.com/jroimartin/gocui v0.4.0/go.mod h1:7i7bbj99OgFHzo7kB2zPb8pXLqMBSQegY7azfqXMkyY=
github.com/awesome-gocui/gocui v0.6.0 h1:hhDJiQC12tEsJNJ+iZBBVaSSLFYo9llFuYpQlL5JZVI=
github.com/awesome-gocui/gocui v0.6.0/go.mod h1:1QikxFaPhe2frKeKvEwZEIGia3haiOxOUXKinrv17mA=
github.com/awesome-gocui/termbox-go v0.0.0-20190427202837-c0aef3d18bcc h1:wGNpKcHU8Aadr9yOzsT3GEsFLS7HQu8HxQIomnekqf0=
github.com/awesome-gocui/termbox-go v0.0.0-20190427202837-c0aef3d18bcc/go.mod h1:tOy3o5Nf1bA17mnK4W41gD7PS3u4Cv0P0pqFcoWMy8s=
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/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/nsf/termbox-go v0.0.0-20190624072549-eeb6cd0a1762 h1:44Lv0bNi88GweB54TCjB/lEJgp+2Ze5WFpwNu0nh0ag=
github.com/nsf/termbox-go v0.0.0-20190624072549-eeb6cd0a1762/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
github.com/voloshink/dggchat v0.0.0-20171209033102-97642b4d160e h1:qszPE5tSNvsYJErKxKdECVtODU9fzi/F37qFjwR1jRU=
github.com/voloshink/dggchat v0.0.0-20171209033102-97642b4d160e/go.mod h1:5j1ON0lAci8VnW4dkkgsmJcO/wWrzhonglKAxV5FHXA=
2 changes: 1 addition & 1 deletion guiwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sync"
"time"

"github.com/jroimartin/gocui"
"github.com/awesome-gocui/gocui"
)

type guiwrapper struct {
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"time"

"github.com/BurntSushi/toml"
"github.com/jroimartin/gocui"
"github.com/awesome-gocui/gocui"
"github.com/voloshink/dggchat"
)

Expand Down Expand Up @@ -61,7 +61,7 @@ func main() {
log.Fatalf("malformed configuration file: %v\n", err)
}

g, err := gocui.NewGui(gocui.OutputNormal)
g, err := gocui.NewGui(gocui.OutputNormal, false)
if err != nil {
log.Panicln(err)
}
Expand Down
22 changes: 11 additions & 11 deletions ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"time"

"github.com/jroimartin/gocui"
"github.com/awesome-gocui/gocui"
"github.com/voloshink/dggchat"
)

Expand Down Expand Up @@ -64,17 +64,17 @@ func layout(g *gocui.Gui) error {
maxX, maxY := g.Size()
g.Cursor = true

if messages, err := g.SetView("debug", maxX/4*2, 0, maxX-20, maxY/3); err != nil {
if err != gocui.ErrUnknownView {
if messages, err := g.SetView("debug", int(maxX/4*2), 0, maxX-20, maxY/3, 0); err != nil {
if !gocui.IsUnknownView(err) {
return err
}
messages.Title = " debug: "
messages.Wrap = true
messages.Autoscroll = true
}

if messages, err := g.SetView("help", maxX/4*2, 0, maxX-20, maxY/2); err != nil {
if err != gocui.ErrUnknownView {
if messages, err := g.SetView("help", maxX/4*2, 0, maxX-20, maxY/2, 0); err != nil {
if !gocui.IsUnknownView(err) {
return err
}
messages.Title = " help: "
Expand Down Expand Up @@ -107,17 +107,17 @@ func layout(g *gocui.Gui) error {
xDimension = maxX - 1
}

if messages, err := g.SetView("messages", 0, 0, xDimension, maxY-3); err != nil {
if err != gocui.ErrUnknownView {
if messages, err := g.SetView("messages", 0, 0, xDimension, maxY-3, 0); err != nil {
if !gocui.IsUnknownView(err) {
return err
}
messages.Title = " messages: "
messages.Autoscroll = true
messages.Wrap = true
}

if input, err := g.SetView("input", 0, maxY-3, xDimension, maxY-1); err != nil {
if err != gocui.ErrUnknownView {
if input, err := g.SetView("input", 0, maxY-3, xDimension, maxY-1, 0); err != nil {
if !gocui.IsUnknownView(err) {
return err
}
input.Title = " send: "
Expand All @@ -128,8 +128,8 @@ func layout(g *gocui.Gui) error {
g.SetCurrentView("input")
}

if users, err := g.SetView("users", maxX-20, 0, maxX-1, maxY-1); err != nil {
if err != gocui.ErrUnknownView {
if users, err := g.SetView("users", maxX-20, 0, maxX-1, maxY-1, 0); err != nil {
if !gocui.IsUnknownView(err) {
return err
}
users.Title = " users: "
Expand Down

0 comments on commit 6ee59f2

Please sign in to comment.