Skip to content

Commit

Permalink
Fix slice bound error on extremely narrow screen
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Dec 5, 2020
1 parent b62a74b commit f502725
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,7 @@ func (t *Terminal) displayWidthWithLimit(runes []rune, prefixWidth int, limit in
}

func (t *Terminal) trimLeft(runes []rune, width int) ([]rune, int32) {
width = util.Max(0, width)
var trimmed int32
// Assume that each rune takes at least one column on screen
if len(runes) > width {
Expand Down

0 comments on commit f502725

Please sign in to comment.