diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-03-15 01:46:14 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-15 01:46:14 -0400 |
commit | 24dfc4712647008a89d930b269b085c6c3f2fb2d (patch) | |
tree | 0f64c306f8e3dd28fea5c8b900ef37078607e14d /widgets/exline.go | |
parent | 8d20e9218ece5927d786d6e2fac5c50572fb9c81 (diff) | |
download | aerc-24dfc4712647008a89d930b269b085c6c3f2fb2d.tar.gz |
Rig up key bindings
Diffstat (limited to 'widgets/exline.go')
-rw-r--r-- | widgets/exline.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/widgets/exline.go b/widgets/exline.go index 77f1414..7eff74a 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()) |