Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions Completions/_autocomplete__history_lines
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,17 @@ _autocomplete__history_lines() {
builtin compadd "$suf[@]" -QU -ld displays "$expl[@]" -a matches
}

_autocomplete__history_lines_suffix() {
if [[ SUFFIX_ACTIVE -ne 0 && $WIDGET != history-search-backward ]]; then
LBUFFER="$LBUFFER[1,SUFFIX_START]"
RBUFFER="$RBUFFER[SUFFIX_END,-1]"
fi
}
if is-at-least 5.9; then
_autocomplete__history_lines_suffix() {
if [[ SUFFIX_ACTIVE -ne 0 && $WIDGET != history-search-backward ]]; then
LBUFFER="$LBUFFER[1,SUFFIX_START]"
RBUFFER="$RBUFFER[SUFFIX_END,-1]"
fi
}
else
_autocomplete__history_lines_suffix() {
[[ $KEYS[-1] != $'\C-@' ]] && LBUFFER=$LBUFFER[1,-1-$1]
}
fi

_autocomplete__history_lines "$@"
Loading