Skip to content

Commit

Permalink
Gracefully handle being sourced multiple times
Browse files Browse the repository at this point in the history
Should fix #126
  • Loading branch information
ericfreese committed Feb 18, 2017
1 parent a0fcd81 commit 75e8505
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bind.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ _zsh_autosuggest_bind_widget() {

# User-defined widget
user:*)
zle -l "$prefix$widget" && zle -N "$widget" ${widgets[$prefix$widget]#*:}
zle -N $prefix$widget ${widgets[$widget]#*:}
;;

Expand Down
1 change: 1 addition & 0 deletions zsh-autosuggestions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ _zsh_autosuggest_bind_widget() {

# User-defined widget
user:*)
zle -l "$prefix$widget" && zle -N "$widget" ${widgets[$prefix$widget]#*:}
zle -N $prefix$widget ${widgets[$widget]#*:}
;;

Expand Down

0 comments on commit 75e8505

Please sign in to comment.