Skip to content

Commit

Permalink
Insert ; only for multiple history lines
Browse files Browse the repository at this point in the history
Otherwise, always discard it.

Fixes #297.
  • Loading branch information
marlonrichert committed Jul 17, 2021
1 parent 781d322 commit c4287a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion completion/_autocomplete.history_lines
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ _autocomplete.history_lines() {
displays=( ${(@n)displays} )
(( diff > 0 )) &&
shift "$diff" displays
sopt=( -S ';' -r '^ ' )
sopt=( -S ';' -R _autocomplete.history_lines.suffix )
eval '
_autocomplete.history_lines.suffix() {
[[ $WIDGET != '$WIDGET' ]] &&
LBUFFER="$LBUFFER[1,-1-$1]"
}'
fi

local -a matches=( "${displays[@]##[[:blank:]]#<->:}" )
Expand Down

0 comments on commit c4287a8

Please sign in to comment.