You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
495 B
Plaintext
21 lines
495 B
Plaintext
5 years ago
|
function _p9k_on_widget() {
|
||
|
zle _p9k_orig_$1 "${@:2}"
|
||
|
}
|
||
|
|
||
|
time ( repeat 1000 ( () {
|
||
|
local tmp=${TMPDIR:-/tmp}/p10k.bindings.$sysparams[pid]
|
||
|
{
|
||
|
bindkey >$tmp
|
||
|
local widget
|
||
|
for widget in ${(u)${${(f)"$(<$tmp)"}:#*\"}##* }; do
|
||
|
functions[_p9k_widget_$widget]='_p9k_on_widget '${(q)widget}' "$@"'
|
||
|
zle -A $widget _p9k_orig_$widget
|
||
|
zle -N $widget _p9k_widget_$widget
|
||
|
done
|
||
|
} always {
|
||
|
zf_rm -f $tmp
|
||
|
}
|
||
|
} ) ) # 2.774s
|
||
|
|
||
|
time ( repeat 1000 ( () {} ) ) # 0.960s
|