Skip to content

Commit bc63a16

Browse files
authored
Merge pull request #370 from mum4k/release_v0_19_0
Releasing Termdash v0.19.0. ## Added - Support for "Backtab" (a.k.a. Shift+Tab) as a supported keystroke for tcell widgets. ## Changed - Migrated CI from Travis to Github Actions. - Bump github.com/gdamore/tcell/v2 from 2.5.4 to 2.7.0. - Change the Go version in `go.mod` to 1.21. - Executed `go mod tidy`. - CI now executes tests with Golang v1.20 and v1.21.
2 parents 428633d + a435b03 commit bc63a16

File tree

10 files changed

+53
-23
lines changed

10 files changed

+53
-23
lines changed

.github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
go-version: [ '1.20', 'stable' ]
18+
go-version: [ '1.20', '1.21', 'stable' ]
1919

2020
steps:
2121
- uses: actions/checkout@v4

CHANGELOG.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.19.0] - 29-Jan-2024
11+
12+
### Added
13+
14+
- Support for "Backtab" (a.k.a. Shift+Tab) as a supported keystroke for tcell
15+
widgets.
16+
17+
### Changed
18+
19+
- Migrated CI from Travis to Github Actions.
20+
- Bump github.com/gdamore/tcell/v2 from 2.5.4 to 2.7.0.
21+
- Change the Go version in `go.mod` to 1.21.
22+
- Executed `go mod tidy`.
23+
- CI now executes tests with Golang v1.20 and v1.21.
24+
1025
## [0.18.0] - 08-Feb-2023
1126

1227
### Added
@@ -516,7 +531,8 @@ identifiers shouldn't be used externally.
516531
- The Gauge widget.
517532
- The Text widget.
518533

519-
[unreleased]: https://github.com/mum4k/termdash/compare/v0.17.0...devel
534+
[unreleased]: https://github.com/mum4k/termdash/compare/v0.19.0...devel
535+
[0.19.0]: https://github.com/mum4k/termdash/compare/v0.18.0...v0.19.0
520536
[0.18.0]: https://github.com/mum4k/termdash/compare/v0.17.0...v0.18.0
521537
[0.17.0]: https://github.com/mum4k/termdash/compare/v0.16.1...v0.17.0
522538
[0.16.1]: https://github.com/mum4k/termdash/compare/v0.16.0...v0.16.1

container/container_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,7 @@ func TestMouse(t *testing.T) {
19391939
),
19401940
Right(
19411941
PlaceWidget(fakewidget.New(widgetapi.Options{WantKeyboard: widgetapi.KeyScopeFocused})),
1942-
KeyFocusPrevious(keyboard.KeyTab),
1942+
KeyFocusPrevious(keyboard.KeyBacktab),
19431943
),
19441944
),
19451945
)
@@ -1949,7 +1949,7 @@ func TestMouse(t *testing.T) {
19491949
return c, nil
19501950
},
19511951
events: []terminalapi.Event{
1952-
&terminalapi.Keyboard{Key: keyboard.KeyTab},
1952+
&terminalapi.Keyboard{Key: keyboard.KeyBacktab},
19531953
},
19541954
want: func(size image.Point) *faketerm.Terminal {
19551955
ft := faketerm.MustNew(size)
@@ -1966,7 +1966,7 @@ func TestMouse(t *testing.T) {
19661966
&widgetapi.Meta{Focused: true},
19671967
widgetapi.Options{WantKeyboard: widgetapi.KeyScopeFocused},
19681968
&fakewidget.Event{
1969-
Ev: &terminalapi.Keyboard{Key: keyboard.KeyTab},
1969+
Ev: &terminalapi.Keyboard{Key: keyboard.KeyBacktab},
19701970
Meta: &widgetapi.EventMeta{Focused: true},
19711971
},
19721972
)

container/focus_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ func TestFocusTrackerNextAndPrevious(t *testing.T) {
529529

530530
const (
531531
keyNext keyboard.Key = keyboard.KeyTab
532-
keyPrevious keyboard.Key = '~'
532+
keyPrevious keyboard.Key = keyboard.KeyBacktab
533533
)
534534

535535
tests := []struct {

go.mod

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
module github.com/mum4k/termdash
22

3-
go 1.20
3+
go 1.21
44

55
require (
6-
github.com/gdamore/tcell/v2 v2.5.4
6+
github.com/gdamore/tcell/v2 v2.7.0
77
github.com/kylelemons/godebug v1.1.0
8-
github.com/mattn/go-runewidth v0.0.14
8+
github.com/mattn/go-runewidth v0.0.15
99
github.com/nsf/termbox-go v1.1.1
1010
)
1111

1212
require (
1313
github.com/gdamore/encoding v1.0.0 // indirect
1414
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
15-
github.com/rivo/uniseg v0.2.0 // indirect
16-
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
17-
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
18-
golang.org/x/text v0.5.0 // indirect
15+
github.com/rivo/uniseg v0.4.3 // indirect
16+
golang.org/x/sys v0.15.0 // indirect
17+
golang.org/x/term v0.15.0 // indirect
18+
golang.org/x/text v0.14.0 // indirect
1919
)

go.sum

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,52 @@
11
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
22
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
3-
github.com/gdamore/tcell/v2 v2.5.4 h1:TGU4tSjD3sCL788vFNeJnTdzpNKIw1H5dgLnJRQVv/k=
4-
github.com/gdamore/tcell/v2 v2.5.4/go.mod h1:dZgRy5v4iMobMEcWNYBtREnDZAT9DYmfqIkrgEMxLyw=
3+
github.com/gdamore/tcell/v2 v2.7.0 h1:I5LiGTQuwrysAt1KS9wg1yFfOI3arI3ucFrxtd/xqaA=
4+
github.com/gdamore/tcell/v2 v2.7.0/go.mod h1:hl/KtAANGBecfIPxk+FzKvThTqI84oplgbPEmVX60b8=
55
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
66
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
77
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
88
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
99
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
10-
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
11-
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
10+
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
11+
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
1212
github.com/nsf/termbox-go v1.1.1 h1:nksUPLCb73Q++DwbYUBEglYBRPZyoXJdrj5L+TkjyZY=
1313
github.com/nsf/termbox-go v1.1.1/go.mod h1:T0cTdVuOwf7pHQNtfhnEbzHbcNyCEcVU4YPpouCbVxo=
14-
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
1514
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
15+
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
16+
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
1617
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
1718
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
1819
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
1920
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
21+
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
2022
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
2123
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
2224
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
25+
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
2326
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
2427
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
28+
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
2529
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
2630
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2731
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
2832
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
29-
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
3033
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
34+
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
35+
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
36+
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
3137
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
3238
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
33-
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM=
34-
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
39+
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
40+
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
41+
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
3542
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
3643
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
3744
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
38-
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
39-
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
45+
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
46+
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
47+
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
4048
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
4149
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
4250
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
51+
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
4352
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

keyboard/keyboard.go

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ var buttonNames = map[Key]string{
6565
KeyCtrlG: "KeyCtrlG",
6666
KeyBackspace: "KeyBackspace",
6767
KeyTab: "KeyTab",
68+
KeyBacktab: "KeyBacktab",
6869
KeyCtrlJ: "KeyCtrlJ",
6970
KeyCtrlK: "KeyCtrlK",
7071
KeyCtrlL: "KeyCtrlL",
@@ -130,6 +131,7 @@ const (
130131
KeyCtrlG
131132
KeyBackspace
132133
KeyTab
134+
KeyBacktab
133135
KeyCtrlJ
134136
KeyCtrlK
135137
KeyCtrlL

terminal/tcell/event.go

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ var tcellToTd = map[tcell.Key]keyboard.Key{
7777
tcell.KeyCtrlZ: keyboard.KeyCtrlZ,
7878
tcell.KeyBackspace: keyboard.KeyBackspace,
7979
tcell.KeyTab: keyboard.KeyTab,
80+
tcell.KeyBacktab: keyboard.KeyBacktab,
8081
tcell.KeyEscape: keyboard.KeyEsc,
8182
tcell.KeyCtrlBackslash: keyboard.KeyCtrlBackslash,
8283
tcell.KeyCtrlRightSq: keyboard.KeyCtrlRsqBracket,

terminal/tcell/event_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ func TestKeyboardKeys(t *testing.T) {
218218
{key: tcell.KeyBackspace, want: keyboard.KeyCtrlH},
219219
{key: tcell.KeyCtrlH, want: keyboard.KeyBackspace},
220220
{key: tcell.KeyTab, want: keyboard.KeyTab},
221+
{key: tcell.KeyBacktab, want: keyboard.KeyBacktab},
221222
{key: tcell.KeyTab, want: keyboard.KeyCtrlI},
222223
{key: tcell.KeyCtrlI, want: keyboard.KeyTab},
223224
{key: tcell.KeyCtrlJ, want: keyboard.KeyCtrlJ},

widgets/textinput/formdemo/formdemo.go

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ func newForm(cancel context.CancelFunc) (*form, error) {
167167
func formLayout(c *container.Container, f *form) error {
168168
return c.Update("root",
169169
container.KeyFocusNext(keyboard.KeyTab),
170+
container.KeyFocusPrevious(keyboard.KeyBacktab),
170171
container.KeyFocusGroupsNext(keyboard.KeyArrowDown, 1),
171172
container.KeyFocusGroupsPrevious(keyboard.KeyArrowUp, 1),
172173
container.KeyFocusGroupsNext(keyboard.KeyArrowRight, 2),

0 commit comments

Comments
 (0)