From 8af98f7d29e685c41a0c4ac28c01f0c5bd98eb3c Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 8 Nov 2013 11:49:33 -0300 Subject: [PATCH] Validate original widget name when restoring on autosuggest-pause --- autosuggestions.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autosuggestions.zsh b/autosuggestions.zsh index 5e1d22f..f650486 100644 --- a/autosuggestions.zsh +++ b/autosuggestions.zsh @@ -51,7 +51,8 @@ autosuggest-pause() { zle -A autosuggest-backward-delete-char-orig backward-delete-char zle -A autosuggest-accept-line-orig accept-line for widget in $ZLE_AUTOSUGGEST_ACCEPT_WIDGETS $ZLE_AUTOSUGGEST_SUSPEND_WIDGETS $ZLE_AUTOSUGGEST_COMPLETION_WIDGETS; do - [[ -z $widgets[$widget] ]] && continue + [[ -z $widgets[$widget] || -z $widgets[autosuggest-${widget}-orig] ]] &&\ + continue eval "zle -A autosuggest-${widget}-orig ${widget}" done autosuggest-highlight-suggested-text