mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-24 20:33:04 +00:00
Guard to not run trap handler twice while in .recursive-edit
This commit is contained in:
parent
b682066065
commit
619c27c2cf
1 changed files with 3 additions and 2 deletions
|
@ -31,7 +31,7 @@ autoload is-at-least
|
|||
|
||||
typeset -g __hsmw_hcw_index
|
||||
typeset -g __hsmw_hcw_widget_name __hsmw_hcw_restart __hsmw_hcw_call_count
|
||||
typeset -g __hsmw_page_size __hsmw_hl_color __hsmw_synhl __hsmw_active
|
||||
typeset -g __hsmw_page_size __hsmw_hl_color __hsmw_synhl __hsmw_active __hsmw_recedit_trap_executed
|
||||
typeset -ga __hsmw_disp_list
|
||||
typeset -gi __hsmw_page_start_idx
|
||||
typeset -gaU __hsmw_hcw_found
|
||||
|
@ -283,7 +283,8 @@ if [ "$__hsmw_hcw_call_count" -eq "1" ]; then
|
|||
bindkey -M hsmw "^[" _hsmw_cancel_accept
|
||||
|
||||
# Trap INT to manually interrupt Zle to work around a bug
|
||||
trap 'zle && zle .send-break' INT
|
||||
__hsmw_recedit_trap_executed=0
|
||||
trap '(( __hsmw_recedit_trap_executed == 0 )) && zle && { __hsmw_recedit_trap_executed=1; zle .send-break; }' INT
|
||||
|
||||
if zle .recursive-edit -K hsmw; then
|
||||
trap '' INT
|
||||
|
|
Loading…
Reference in a new issue