Skip to content

Commit

Permalink
Let space remove ; history line suffix
Browse files Browse the repository at this point in the history
Resolves #361.
  • Loading branch information
marlonrichert committed Nov 6, 2021
1 parent a37ca02 commit fe20fc5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion functions/completion/_autocomplete.history_lines
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,20 @@ _autocomplete.history_lines() {
local -a expl=()
local _comp_no_ignore=1
_description -2V "$tag" expl 'history line'
builtin compadd "$expl[@]" -qS "$suf" -QU -ld displays -a matches
builtin compadd "$expl[@]" -S "$suf" -R _autocomplete.history_lines.suffix \
-QU -ld displays -a matches
}
# functions -T _autocomplete.history_lines

_autocomplete.history_lines.suffix() {
case $KEYS in
( [$ZLE_SPACE_SUFFIX_CHARS$ZLE_REMOVE_SUFFIX_CHARS] )
LBUFFER=$LBUFFER[1,-1-$1]
;|
( [$ZLE_SPACE_SUFFIX_CHARS] )
LBUFFER+=' '
;;
esac
}

_autocomplete.history_lines "$@"

0 comments on commit fe20fc5

Please sign in to comment.