Fix incorrect tab character handling

Fix #2372
This commit is contained in:
Junegunn Choi 2021-03-12 10:06:44 +09:00
parent 5a874ae241
commit 8fccf20892
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -1146,8 +1146,8 @@ 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 {
diff := len(runes) - width
if len(runes) > width+2 {
diff := len(runes) - width - 2
trimmed = int32(diff)
runes = runes[diff:]
}