summaryrefslogtreecommitdiffstats
path: root/src/terminal.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/terminal.go')
-rw-r--r--src/terminal.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/terminal.go b/src/terminal.go
index c036117e..0e9436a7 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -401,6 +401,8 @@ func displayWidth(runes []rune) int {
const (
minWidth = 16
minHeight = 4
+
+ maxDisplayWidthCalc = 1024
)
func calculateSize(base int, size sizeSpec, margin int, minSize int) int {
@@ -651,6 +653,11 @@ func displayWidthWithLimit(runes []rune, prefixWidth int, limit int) int {
}
func trimLeft(runes []rune, width int) ([]rune, int32) {
+ if len(runes) > maxDisplayWidthCalc && len(runes) > width {
+ trimmed := len(runes) - width
+ return runes[trimmed:], int32(trimmed)
+ }
+
currentWidth := displayWidth(runes)
var trimmed int32