Repository: gokcehan/lf
Pull request #311 (2020-03-18 17:20:01)

Use doronbehar's fork of termbox
See https://github.com/gokcehan/lf/issues/302 .


Patch:
diff --git a/.travis.yml b/.travis.yml
index 93b0b25..6639f76 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
 language: go
 install:
-  - go get github.com/nsf/termbox-go
+  - go get github.com/doronbehar/termbox-go
   - go get gopkg.in/djherbis/times.v1
 before_deploy:
   - gen/xbuild.sh
diff --git a/client.go b/client.go
index 6d19ba7..1c580bb 100644
--- a/client.go
+++ b/client.go
@@ -10,7 +10,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/nsf/termbox-go"
+	"github.com/doronbehar/termbox-go"
 )
 
 func run() {
diff --git a/colors.go b/colors.go
index a976831..9d3ac83 100644
--- a/colors.go
+++ b/colors.go
@@ -7,7 +7,7 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/nsf/termbox-go"
+	"github.com/doronbehar/termbox-go"
 )
 
 const gAnsiColorResetMask = termbox.AttrBold | termbox.AttrUnderline | termbox.AttrReverse
diff --git a/go.mod b/go.mod
index 7b68baf..3508d63 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/gokcehan/lf
 go 1.12
 
 require (
+	github.com/doronbehar/termbox-go v0.0.0-20191006141301-8c9470559e05
 	github.com/mattn/go-runewidth v0.0.4
-	github.com/nsf/termbox-go v0.0.0-20190325093121-288510b9734e
 	gopkg.in/djherbis/times.v1 v1.2.0
 )
diff --git a/go.sum b/go.sum
index e8f606b..c7cbdf9 100644
--- a/go.sum
+++ b/go.sum
@@ -1,6 +1,10 @@
+github.com/doronbehar/termbox-go v0.0.0-20190817171036-93860e161317 h1:mdOm+1RdYwVwC4Wjb53M5L96fRwWJ8gI7YXwwiCsHTk=
+github.com/doronbehar/termbox-go v0.0.0-20190817171036-93860e161317/go.mod h1:cHYbFQiZNC8LPG6clYoLMKAl0xx7KR75RPsHtG/f1Hk=
+github.com/doronbehar/termbox-go v0.0.0-20191006140624-aa2cdd26fb8c h1:qvLYQAhDCaMq+XiQ+t4YLaTJtUyHC1r20odd6ryKYIk=
+github.com/doronbehar/termbox-go v0.0.0-20191006140624-aa2cdd26fb8c/go.mod h1:cHYbFQiZNC8LPG6clYoLMKAl0xx7KR75RPsHtG/f1Hk=
+github.com/doronbehar/termbox-go v0.0.0-20191006141301-8c9470559e05 h1:pmXx7j8+mmkFJB2+qoB1C/Mz8SWvMlHTxSWOptJrr7E=
+github.com/doronbehar/termbox-go v0.0.0-20191006141301-8c9470559e05/go.mod h1:cHYbFQiZNC8LPG6clYoLMKAl0xx7KR75RPsHtG/f1Hk=
 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-20190325093121-288510b9734e h1:Vbib8wJAaMEF9jusI/kMSYMr/LtRzM7+F9MJgt/nH8k=
-github.com/nsf/termbox-go v0.0.0-20190325093121-288510b9734e/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
 gopkg.in/djherbis/times.v1 v1.2.0 h1:UCvDKl1L/fmBygl2Y7hubXCnY7t4Yj46ZrBFNUipFbM=
 gopkg.in/djherbis/times.v1 v1.2.0/go.mod h1:AQlg6unIsrsCEdQYhTzERy542dz6SFdQFZFv6mUY0P8=
diff --git a/ui.go b/ui.go
index c3c38bf..c68222a 100644
--- a/ui.go
+++ b/ui.go
@@ -16,7 +16,7 @@ import (
 	"unicode/utf8"
 
 	"github.com/mattn/go-runewidth"
-	"github.com/nsf/termbox-go"
+	"github.com/doronbehar/termbox-go"
 )
 
 const gEscapeCode = 27
@@ -870,27 +870,6 @@ func (ui *ui) readEvent(ch chan<- expr, ev termbox.Event) {
 			ui.keyAcc = nil
 			ui.keyCount = nil
 			ui.menuBuf = nil
-		case 1:
-			if ok {
-				if len(ui.keyCount) > 0 {
-					c, err := strconv.Atoi(string(ui.keyCount))
-					if err != nil {
-						log.Printf("converting command count: %s", err)
-					}
-					count = c
-				}
-				expr := gOpts.keys[string(ui.keyAcc)]
-				if e, ok := expr.(*callExpr); ok {
-					e.count = count
-				}
-				ch <- expr
-				ui.keyAcc = nil
-				ui.keyCount = nil
-				ui.menuBuf = nil
-			} else {
-				ui.menuBuf = listBinds(binds)
-				ch <- draw
-			}
 		default:
 			if ok {
 				if len(ui.keyCount) > 0 {


Test patch:
diff --git a/colors_test.go b/colors_test.go
index ff93b48..2d4b868 100644
--- a/colors_test.go
+++ b/colors_test.go
@@ -3,7 +3,7 @@ package main
 import (
 	"testing"
 
-	"github.com/nsf/termbox-go"
+	"github.com/doronbehar/termbox-go"
 )
 
 func TestApplyAnsiCodes(t *testing.T) {