summary refs log tree commit diff stats
path: root/widgets/exline.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/exline.go')
-rw-r--r--widgets/exline.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/widgets/exline.go b/widgets/exline.go
index c841802..a5b896f 100644
--- a/widgets/exline.go
+++ b/widgets/exline.go
@@ -10,7 +10,6 @@ type ExLine struct {
 	ui.Invalidatable
 	cancel func()
 	commit func(cmd string)
-	ctx    *ui.Context
 	input  *ui.TextInput
 }
 
@@ -32,7 +31,6 @@ func (ex *ExLine) Invalidate() {
 }
 
 func (ex *ExLine) Draw(ctx *ui.Context) {
-	ex.ctx = ctx // gross
 	ex.input.Draw(ctx)
 }
 
@@ -45,14 +43,10 @@ func (ex *ExLine) Event(event tcell.Event) bool {
 	case *tcell.EventKey:
 		switch event.Key() {
 		case tcell.KeyEnter:
-			if ex.ctx != nil {
-				ex.ctx.HideCursor()
-			}
+			ex.input.Focus(false)
 			ex.commit(ex.input.String())
 		case tcell.KeyEsc, tcell.KeyCtrlC:
-			if ex.ctx != nil {
-				ex.ctx.HideCursor()
-			}
+			ex.input.Focus(false)
 			ex.cancel()
 		default:
 			return ex.input.Event(event)
&id=504292f6f1a283af39de305879b50f16d6180caa'>^
4a48bedc ^
4c513685 ^
01ce563d ^
58d918de ^
4c513685 ^

5059f32d ^
4c513685 ^

58d918de ^


5059f32d ^
dd660682 ^
4c513685 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47