Skip to content

Commit

Permalink
Inline default autosuggestion function to speed up
Browse files Browse the repository at this point in the history
  • Loading branch information
lbolla committed Jul 13, 2016
1 parent 62cdba4 commit dac5b7f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion zsh-autosuggestions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,17 @@ _zsh_autosuggest_modify() {
# Get a new suggestion if the buffer is not empty after modification
local suggestion
if [ $#BUFFER -gt 0 ]; then
suggestion="$(_zsh_autosuggest_suggestion "$BUFFER")"
# suggestion="$(_zsh_autosuggest_suggestion "$BUFFER")"

# TODO inline _zsh_autosuggest_strategy_default
local prefix="$BUFFER"

# Get the keys of the history items that match
local -a histkeys
histkeys=(${(k)history[(r)$prefix*]})

# Echo the value of the first key
suggestion="${history[$histkeys[1]]}"
fi

# Add the suggestion to the POSTDISPLAY
Expand Down

0 comments on commit dac5b7f

Please sign in to comment.