summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2021-03-12 10:06:44 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2021-03-12 10:08:18 +0900
commit8fccf208923ebe96df6a4506b4e454a75edffe4c (patch)
treef8516def662764d2a6422cbb6974e7a8d678359e
parent5a874ae241af64368e65b667592918b3fdb17177 (diff)
Fix incorrect tab character handling
Fix #2372
-rw-r--r--src/terminal.go4
1 files 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:]
}