From bc68a91f0a88d1925a00e228ed91f455957b412d Mon Sep 17 00:00:00 2001 From: anind3r Date: Sun, 6 Jul 2025 10:32:39 +0700 Subject: [PATCH 1/3] Fix: Split widgets entry and extract needed parts Fixes #825 --- zsh-autosuggestions.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index e780225..1bfde5c 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -173,7 +173,8 @@ _zsh_autosuggest_bind_widget() { # Completion widget completion:*) _zsh_autosuggest_incr_bind_count $widget - eval "zle -C $prefix$bind_count-${(q)widget} ${${(s.:.)widgets[$widget]}[2,3]}" + local -a widget_split=("${(@s.:.)widgets[$widget]}") + eval "zle -C "$prefix$bind_count-${(q)widget}" "${widget_split[2]}" "${widget_split[3]}" ;; esac From 5434e8b86fb6ec79216db32a37bc5c09811e4eac Mon Sep 17 00:00:00 2001 From: anind3r Date: Sun, 6 Jul 2025 10:56:09 +0700 Subject: [PATCH 2/3] Use single quotes for eval --- zsh-autosuggestions.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 1bfde5c..194e063 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -173,9 +173,8 @@ _zsh_autosuggest_bind_widget() { # Completion widget completion:*) _zsh_autosuggest_incr_bind_count $widget - local -a widget_split=("${(@s.:.)widgets[$widget]}") - eval "zle -C "$prefix$bind_count-${(q)widget}" "${widget_split[2]}" "${widget_split[3]}" - ;; +local -a widget_split=("${(@s.:.)widgets[$widget]}") +eval 'zle -C "$prefix$bind_count-${(q)widget}" "${widget_split[2]}" "${widget_split[3]}"' ;; esac # Pass the original widget's name explicitly into the autosuggest From dfc939959429503e0c452ab74e130baeccf809e8 Mon Sep 17 00:00:00 2001 From: anind3r Date: Sun, 6 Jul 2025 11:01:34 +0700 Subject: [PATCH 3/3] code formatting --- zsh-autosuggestions.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 194e063..20be0c6 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -173,8 +173,9 @@ _zsh_autosuggest_bind_widget() { # Completion widget completion:*) _zsh_autosuggest_incr_bind_count $widget -local -a widget_split=("${(@s.:.)widgets[$widget]}") -eval 'zle -C "$prefix$bind_count-${(q)widget}" "${widget_split[2]}" "${widget_split[3]}"' ;; + local -a widget_split=("${(@s.:.)widgets[$widget]}") + eval 'zle -C "$prefix$bind_count-${(q)widget}" "${widget_split[2]}" "${widget_split[3]}"' + ;; esac # Pass the original widget's name explicitly into the autosuggest