summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-11-23 01:58:46 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-11-23 01:58:46 +0900
commit8524ea74414cfe0773a4318a6b4d9da87e230a07 (patch)
tree6f9611e8c297e2549b4971038d85c0c2f53ef727
parent6a65006f55c527d86d6924ee296828a50e77a7e9 (diff)
Do not ignore resize event from ncurses and tcell
-rw-r--r--src/terminal.go1
-rw-r--r--src/tui/ncurses.go2
-rw-r--r--src/tui/tcell.go2
-rw-r--r--src/tui/tui.go1
4 files changed, 4 insertions, 2 deletions
diff --git a/src/terminal.go b/src/terminal.go
index 5d4eef87..315d9f18 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -190,6 +190,7 @@ const (
func defaultKeymap() map[int]actionType {
keymap := make(map[int]actionType)
keymap[tui.Invalid] = actInvalid
+ keymap[tui.Resize] = actClearScreen
keymap[tui.CtrlA] = actBeginningOfLine
keymap[tui.CtrlB] = actBackwardChar
keymap[tui.CtrlC] = actAbort
diff --git a/src/tui/ncurses.go b/src/tui/ncurses.go
index 5c192e60..5a4d5382 100644
--- a/src/tui/ncurses.go
+++ b/src/tui/ncurses.go
@@ -416,7 +416,7 @@ func GetChar() Event {
}
return Event{Invalid, 0, nil}
case C.KEY_RESIZE:
- return Event{Invalid, 0, nil}
+ return Event{Resize, 0, nil}
case ESC:
return escSequence()
case 127:
diff --git a/src/tui/tcell.go b/src/tui/tcell.go
index 3ea04124..efa112a9 100644
--- a/src/tui/tcell.go
+++ b/src/tui/tcell.go
@@ -183,7 +183,7 @@ func GetChar() Event {
ev := _screen.PollEvent()
switch ev := ev.(type) {
case *tcell.EventResize:
- return Event{Invalid, 0, nil}
+ return Event{Resize, 0, nil}
// process mouse events:
case *tcell.EventMouse:
diff --git a/src/tui/tui.go b/src/tui/tui.go
index 7513b6fb..6fcaaa44 100644
--- a/src/tui/tui.go
+++ b/src/tui/tui.go
@@ -37,6 +37,7 @@ const (
ESC
Invalid
+ Resize
Mouse
DoubleClick