Add keys Left and Right to switch tab. Also, add Escape as quit key.

This commit is contained in:
Kalle Carlbark 2019-08-29 20:22:11 +02:00
parent e0733f5ce6
commit df4d0a2ab0
No known key found for this signature in database
GPG key ID: 3FC0C93C5A5A0670

View file

@ -250,17 +250,17 @@ func main() {
select { select {
case e := <-uiEvents: case e := <-uiEvents:
switch e.ID { switch e.ID {
case "h": case "h", "<Left>":
tabpane.FocusLeft() tabpane.FocusLeft()
termui.Clear() termui.Clear()
termui.Render(tabpane) termui.Render(tabpane)
renderTab() renderTab()
case "l": case "l", "<Right>":
tabpane.FocusRight() tabpane.FocusRight()
termui.Clear() termui.Clear()
termui.Render(tabpane) termui.Render(tabpane)
renderTab() renderTab()
case "q", "<C-c>": case "q", "<Escape>", "<C-c>":
return return
case "r": case "r":
termui.Clear() termui.Clear()