mirror of https://github.com/rivo/tview.git
Fixed a bug where neighbouring colour tags were processed incorrectly. Fixes #241
This commit is contained in:
parent
03d744dee3
commit
3548dec808
2
util.go
2
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++
|
||||
|
|
Loading…
Reference in New Issue