aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/exline.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-15 01:46:14 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-15 01:46:14 -0400
commit24dfc4712647008a89d930b269b085c6c3f2fb2d (patch)
tree0f64c306f8e3dd28fea5c8b900ef37078607e14d /widgets/exline.go
parent8d20e9218ece5927d786d6e2fac5c50572fb9c81 (diff)
downloadaerc-24dfc4712647008a89d930b269b085c6c3f2fb2d.tar.gz
Rig up key bindings
Diffstat (limited to 'widgets/exline.go')
-rw-r--r--widgets/exline.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/widgets/exline.go b/widgets/exline.go
index 77f14145..7eff74a1 100644
--- a/widgets/exline.go
+++ b/widgets/exline.go
@@ -121,10 +121,14 @@ func (ex *ExLine) Event(event tcell.Event) bool {
case tcell.KeyCtrlW:
ex.deleteWord()
case tcell.KeyEnter:
- ex.ctx.HideCursor()
+ if ex.ctx != nil {
+ ex.ctx.HideCursor()
+ }
ex.commit(string(ex.command))
case tcell.KeyEsc, tcell.KeyCtrlC:
- ex.ctx.HideCursor()
+ if ex.ctx != nil {
+ ex.ctx.HideCursor()
+ }
ex.cancel()
case tcell.KeyRune:
ex.insert(event.Rune())