mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-25 10:20:31 +00:00
bindings: Add capability to unregister user defined raw escape sequence
This commit is contained in:
parent
dcc7205699
commit
6fa12743d6
1 changed files with 8 additions and 1 deletions
|
|
@ -88,6 +88,10 @@ func BindKey(k, v string, bind func(e Event, a string)) {
|
|||
return
|
||||
}
|
||||
|
||||
if strings.HasPrefix(k, "\x1b") {
|
||||
screen.Screen.RegisterRawSeq(k)
|
||||
}
|
||||
|
||||
bind(event, v)
|
||||
|
||||
// switch e := event.(type) {
|
||||
|
|
@ -153,7 +157,6 @@ modSearch:
|
|||
k = k[5:]
|
||||
modifiers |= tcell.ModShift
|
||||
case strings.HasPrefix(k, "\x1b"):
|
||||
screen.Screen.RegisterRawSeq(k)
|
||||
return RawEvent{
|
||||
esc: k,
|
||||
}, true
|
||||
|
|
@ -322,6 +325,10 @@ func UnbindKey(k string) error {
|
|||
}
|
||||
}
|
||||
|
||||
if strings.HasPrefix(k, "\x1b") {
|
||||
screen.Screen.UnregisterRawSeq(k)
|
||||
}
|
||||
|
||||
defaults := DefaultBindings("buffer")
|
||||
if a, ok := defaults[k]; ok {
|
||||
BindKey(k, a, Binder["buffer"])
|
||||
|
|
|
|||
Loading…
Reference in a new issue