Skip to content

Commit

Permalink
bind: fix a problem that "bind '"seq":"key"'" causes a loop macro "bi…
Browse files Browse the repository at this point in the history
…nd -s key key"
  • Loading branch information
akinomyoga committed May 20, 2021
1 parent 47b3ade commit e2a502d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/decode.sh
Expand Up @@ -2708,10 +2708,13 @@ function ble/builtin/bind/option:- {

if [[ $value == \"* ]]; then
# keyboard macro
local bind_keys="${keys[*]}"
value=${value#\"} value=${value%\"}
local ret chars; ble/util/keyseq2chars "$value"; chars=("${ret[@]}")
local command="ble/widget/.CHARS ${chars[*]}"
ble-decode-key/bind "${keys[*]}" "$command"
ble/builtin/bind/.decode-chars "${chars[@]}"
[[ ${keys[*]} != "$bind_keys" ]] &&
ble-decode-key/bind "$bind_keys" "$command"
elif [[ $value ]]; then
if local ret; ble/builtin/bind/rlfunc2widget "$kmap" "$value"; then
local command=$ret
Expand Down

0 comments on commit e2a502d

Please sign in to comment.