From 3548dec8087ec22eadda7f09c5c34a909f5663ef Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 9 Mar 2019 12:33:12 +0100 Subject: [PATCH] Fixed a bug where neighbouring colour tags were processed incorrectly. Fixes #241 --- util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.go b/util.go index 1c33345..a9d8117 100644 --- a/util.go +++ b/util.go @@ -366,7 +366,7 @@ func printWithStyle(screen tcell.Screen, text string, x, y, maxWidth, align int, } // Handle color tags. - if colorPos < len(colorIndices) && textPos+tagOffset >= colorIndices[colorPos][0] && textPos+tagOffset < colorIndices[colorPos][1] { + for colorPos < len(colorIndices) && textPos+tagOffset >= colorIndices[colorPos][0] && textPos+tagOffset < colorIndices[colorPos][1] { foregroundColor, backgroundColor, attributes = styleFromTag(foregroundColor, backgroundColor, attributes, colors[colorPos]) tagOffset += colorIndices[colorPos][1] - colorIndices[colorPos][0] colorPos++