From 5f33d0cbc09bfcd70ac694f8ff365e20e26168a4 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Fri, 12 Jan 2018 08:35:30 +0100 Subject: [PATCH] Some adaptations for 32-bit systems. Resolves #17 --- inputfield.go | 2 +- textview.go | 2 +- util.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inputfield.go b/inputfield.go index 12a4e5e..4bfd2a7 100644 --- a/inputfield.go +++ b/inputfield.go @@ -185,7 +185,7 @@ func (i *InputField) Draw(screen tcell.Screen) { // Draw input area. fieldLength := i.fieldLength if fieldLength == 0 { - fieldLength = math.MaxInt64 + fieldLength = math.MaxInt32 } if rightLimit-x < fieldLength { fieldLength = rightLimit - x diff --git a/textview.go b/textview.go index 8e6b346..1b2709e 100644 --- a/textview.go +++ b/textview.go @@ -450,7 +450,7 @@ func (t *TextView) reindexBuffer(width int) { t.longestLine = 0 color := t.textColor if !t.wrap { - width = math.MaxInt64 + width = math.MaxInt32 } for index, str := range t.buffer { // Find all color tags in this line. diff --git a/util.go b/util.go index a938187..e4a5188 100644 --- a/util.go +++ b/util.go @@ -158,7 +158,7 @@ func Print(screen tcell.Screen, text string, x, y, maxWidth, align int, color tc // PrintSimple prints white text to the screen at the given position. func PrintSimple(screen tcell.Screen, text string, x, y int) { - Print(screen, text, x, y, math.MaxInt64, AlignLeft, Styles.PrimaryTextColor) + Print(screen, text, x, y, math.MaxInt32, AlignLeft, Styles.PrimaryTextColor) } // WordWrap splits a text such that each resulting line does not exceed the