Skip to content

Commit 11f1145

Browse files
committed
Improve history line suffix removal
1 parent 8993b9c commit 11f1145

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: Completions/_autocomplete__history_lines

+4-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,10 @@ _autocomplete__history_lines() {
148148
}
149149

150150
_autocomplete__history_lines_suffix() {
151-
[[ $KEYS[-1] != $'\C-@' ]] &&
152-
LBUFFER=$LBUFFER[1,-1-$1]
151+
if [[ $WIDGET != history-search-backward ]]; then
152+
LBUFFER="$LBUFFER[1,SUFFIX_START]"
153+
RBUFFER="$RBUFFER[SUFFIX_END,-1]"
154+
fi
153155
}
154156

155157
_autocomplete__history_lines "$@"

0 commit comments

Comments
 (0)