From 681ffc7b2891e97801a2104997ed8524fa2c4556 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Fri, 13 Jul 2018 22:16:53 -0600 Subject: [PATCH] Reset opts in some functions affected by GLOB_SUBST Should fix GitHub #334 --- src/bind.zsh | 4 +++- src/widgets.zsh | 4 ++++ zsh-autosuggestions.zsh | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/bind.zsh b/src/bind.zsh index f538379..bb41ef8 100644 --- a/src/bind.zsh +++ b/src/bind.zsh @@ -74,7 +74,9 @@ _zsh_autosuggest_bind_widget() { # Map all configured widgets to the right autosuggest widgets _zsh_autosuggest_bind_widgets() { - local widget + emulate -L zsh + + local widget local ignore_widgets ignore_widgets=( diff --git a/src/widgets.zsh b/src/widgets.zsh index 746944d..3312579 100644 --- a/src/widgets.zsh +++ b/src/widgets.zsh @@ -37,6 +37,8 @@ _zsh_autosuggest_clear() { # Modify the buffer and get a new suggestion _zsh_autosuggest_modify() { + emulate -L zsh + local -i retval # Only available in zsh >= 5.4 @@ -104,6 +106,8 @@ _zsh_autosuggest_fetch() { # Offer a suggestion _zsh_autosuggest_suggest() { + emulate -L zsh + local suggestion="$1" if [[ -n "$suggestion" ]] && (( $#BUFFER )); then diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index f94859e..4b39dda 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -184,7 +184,9 @@ _zsh_autosuggest_bind_widget() { # Map all configured widgets to the right autosuggest widgets _zsh_autosuggest_bind_widgets() { - local widget + emulate -L zsh + + local widget local ignore_widgets ignore_widgets=( @@ -291,6 +293,8 @@ _zsh_autosuggest_clear() { # Modify the buffer and get a new suggestion _zsh_autosuggest_modify() { + emulate -L zsh + local -i retval # Only available in zsh >= 5.4 @@ -358,6 +362,8 @@ _zsh_autosuggest_fetch() { # Offer a suggestion _zsh_autosuggest_suggest() { + emulate -L zsh + local suggestion="$1" if [[ -n "$suggestion" ]] && (( $#BUFFER )); then