From 8fccf208923ebe96df6a4506b4e454a75edffe4c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 12 Mar 2021 10:06:44 +0900 Subject: [PATCH] Fix incorrect tab character handling Fix #2372 --- src/terminal.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/terminal.go b/src/terminal.go index caafa59c..3afa4bcd 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -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:] }