Skip to content

Commit

Permalink
Fix a bug in history line context matching
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonrichert committed Jun 18, 2021
1 parent beb342c commit ff42f83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions completion/_autocomplete.history_lines
Expand Up @@ -38,8 +38,8 @@ _autocomplete.history_lines() {
local -aU queries results reply
if [[ $curcontext == *-incremental-*:* ]]; then
local word=$IPREFIX$PREFIX$SUFFIX$ISUFFIX
local lbuffer="${words[1,CURRENT-1]}[[:space:]]#"
local rbuffer="[[:space:]]#${words[CURRENT+1,-1]}"
local lbuffer="${words[1,CURRENT-1]}[[:blank:]]#"
local rbuffer="[[:blank:]]#${words[CURRENT+1,-1]}"
queries=( "$lbuffer*((#ia"{0..$(( min(7, $#word / 3) ))}")${(b)word})*$rbuffer" )
else
queries=( '(#ia'{0..$(( min(7, $#words / 3) ))}')*'${words[CURRENT]//$'\0'/*}'*' )
Expand Down Expand Up @@ -96,7 +96,7 @@ _autocomplete.history_lines() {
sopt=( -S ';' -r '^ ' )
fi

local -a matches=( "${displays[@]##[[:space:]]#<->:}" )
local -a matches=( "${displays[@]##[[:blank:]]#<->:}" )
[[ $curcontext == *-incremental-* ]] &&
matches=( "${(@)${(@)matches[@]##$~lbuffer}%%$~rbuffer}" )

Expand Down

0 comments on commit ff42f83

Please sign in to comment.