mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-12-08 15:32:31 +01:00
Bound widgets now handle arguments correctly
This commit is contained in:
parent
011f5420fc
commit
51b39e210e
3 changed files with 20 additions and 20 deletions
|
|
@ -34,9 +34,9 @@ _zsh_autosuggest_bind_widget() {
|
|||
# Set up widget to call $autosuggest_function if it exists
|
||||
# Otherwise just call the original widget
|
||||
if [ -n "$autosuggest_function" ]; then;
|
||||
action=$autosuggest_function;
|
||||
action="$autosuggest_function \$@";
|
||||
else;
|
||||
action="zle $prefix$widget \$@"
|
||||
action="zle $prefix$widget -- \$@"
|
||||
fi
|
||||
|
||||
# Create new function for the widget that highlights and calls the action
|
||||
|
|
@ -72,9 +72,9 @@ _zsh_autosuggest_bind_widgets() {
|
|||
|
||||
# Given the name of a widget, invoke the original we saved, if it exists
|
||||
_zsh_autosuggest_invoke_original_widget() {
|
||||
local original_widget_name="$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX$1"
|
||||
local original_widget_name="$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX$WIDGET"
|
||||
|
||||
if [ $widgets[$original_widget_name] ]; then
|
||||
zle $original_widget_name
|
||||
zle $original_widget_name -- $@
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue