Skip to content
Snippets Groups Projects
Unverified Commit f5027251 authored by Junegunn Choi's avatar Junegunn Choi
Browse files

Fix slice bound error on extremely narrow screen

parent b62a74b3
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment