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.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/widgets/exline.go b/widgets/exline.go
index 7eff74a..5c9f065 100644
--- a/widgets/exline.go
+++ b/widgets/exline.go
@@ -17,6 +17,7 @@ type ExLine struct {
 	ctx     *ui.Context
 	cancel  func()
 	cells   int
+	focus   bool
 	index   int
 	scroll  int
 
@@ -52,6 +53,14 @@ func (ex *ExLine) Draw(ctx *ui.Context) {
 	}
 }
 
+func (ex *ExLine) Focus(focus bool) {
+	ex.focus = focus
+	if focus && ex.ctx != nil {
+		cells := runewidth.StringWidth(string(ex.command[:ex.index]))
+		ex.ctx.SetCursor(cells+1, 0)
+	}
+}
+
 func (ex *ExLine) insert(ch rune) {
 	left := ex.command[:ex.index]
 	right := ex.command[ex.index:]
class='oid'>e6cbe9c ^
0c3544d ^




e6cbe9c ^
0c3544d ^


e6cbe9c ^
e743836 ^
7b5638f ^
0c3544d ^


901b3ed ^
1076f2b

901b3ed ^
0c3544d ^
72655f0 ^





901b3ed ^
72655f0 ^


















7b5638f ^





1549faf ^














ba59bc8 ^
1549faf ^

eb184e0 ^
1549faf ^
0c3544d ^
0e5c819 ^












0c3544d ^

a73a882 ^

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102