Skip to content

Commit

Permalink
Fix negative excess shift in history lines
Browse files Browse the repository at this point in the history
Fixes #587.
  • Loading branch information
jg-byte authored and marlonrichert committed May 18, 2023
1 parent 1a29a30 commit e68e1f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/completion/_autocomplete.history_lines
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ _autocomplete.history_lines() {
displays=( "${(aO)lines[@]}" )
else
(( excess = $#displays[@] - max ))
(( excess )) &&
(( excess > 0 )) &&
shift $excess displays
fi

Expand All @@ -124,7 +124,7 @@ _autocomplete.history_lines() {
fi

(( excess = $#displays[@] - list_lines ))
(( excess )) &&
(( excess > 0 )) &&
shift $pop $excess displays

# To avoid wrapping, each completion should be one char less than terminal width.
Expand Down

0 comments on commit e68e1f6

Please sign in to comment.