mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-24 20:33:04 +00:00
Only define _hsmw_main() once – check $functions before defining
This commit is contained in:
parent
aee52a54ac
commit
619d9c7184
1 changed files with 4 additions and 0 deletions
|
@ -39,6 +39,8 @@ typeset -gaU __hsmw_hcw_found
|
|||
(( __hsmw_hcw_call_count ++ ))
|
||||
trap '(( __hsmw_hcw_call_count -- )); return 0;' INT
|
||||
|
||||
if (( ${+functions[_hsmw_main]} == 0 )); then
|
||||
|
||||
_hsmw_main() {
|
||||
# First call or restart?
|
||||
if [[ "$__hsmw_hcw_call_count" -le 1 || "$__hsmw_hcw_restart" = "1" ]]; then
|
||||
|
@ -165,6 +167,8 @@ _hsmw_main() {
|
|||
region_highlight+=( "$(( offset + ${#txt_before} )) $(( offset + ${#txt_before} + ${#entry} + 1 )) $__hsmw_active" )
|
||||
}
|
||||
|
||||
fi
|
||||
|
||||
_hsmw_main
|
||||
|
||||
_hsmw_simulate_widget() {
|
||||
|
|
Loading…
Reference in a new issue