summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-21 17:49:59 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-21 17:49:59 -0400
commit699f1cf7a65a29ed512d62fd7626dd38d3cd7c7e (patch)
tree63a93cbb707168707d8b72a097aa7bd710b324ea /widgets
parent6d01332b5562738270dbad6c60d61c3652a8f988 (diff)
downloadaerc-699f1cf7a65a29ed512d62fd7626dd38d3cd7c7e.tar.gz
Use : for keybindings even when ex is overridden
Diffstat (limited to 'widgets')
-rw-r--r--widgets/aerc.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 157cdd6..bdf94bd 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -18,6 +18,7 @@ type Aerc struct {
 	focused     libui.Interactive
 	grid        *libui.Grid
 	logger      *log.Logger
+	simulating  int
 	statusbar   *libui.Stack
 	statusline  *StatusLine
 	pendingKeys []config.KeyStroke
@@ -107,11 +108,13 @@ func (aerc *Aerc) getBindings() *config.KeyBindings {
 
 func (aerc *Aerc) simulate(strokes []config.KeyStroke) {
 	aerc.pendingKeys = []config.KeyStroke{}
+	aerc.simulating += 1
 	for _, stroke := range strokes {
 		simulated := tcell.NewEventKey(
 			stroke.Key, stroke.Rune, tcell.ModNone)
 		aerc.Event(simulated)
 	}
+	aerc.simulating -= 1
 }
 
 func (aerc *Aerc) Event(event tcell.Event) bool {
@@ -150,9 +153,12 @@ func (aerc *Aerc) Event(event tcell.Event) bool {
 		}
 		if !incomplete {
 			aerc.pendingKeys = []config.KeyStroke{}
-			if event.Key() == bindings.ExKey.Key &&
-				event.Rune() == bindings.ExKey.Rune {
-
+			exKey := bindings.ExKey
+			if aerc.simulating > 0 {
+				// Keybindings still use : even if you change the ex key
+				exKey = aerc.conf.Bindings.Global.ExKey
+			}
+			if event.Key() == exKey.Key && event.Rune() == exKey.Rune {
 				aerc.BeginExCommand()
 				return true
 			}
r Kartik K. Agaram <vc@akkartik.com> 2015-04-22 19:28:44 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-04-22 19:28:44 -0700 1139' href='/akkartik/mu/commit/cpp/termbox/utf8.c?h=main&id=9a31c34f0f2aab901be29e0844ae2fcb9b3f4a13'>9a31c34f ^
5f128523 ^
9a31c34f ^


















5f128523 ^
9a31c34f ^




5f128523 ^
9a31c34f ^
5f128523 ^
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