aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/exline.go
diff options
context:
space:
mode:
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())