mirror of
https://github.com/rivo/tview.git
synced 2025-04-24 13:48:56 +08:00
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.
|
// 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])
|
foregroundColor, backgroundColor, attributes = styleFromTag(foregroundColor, backgroundColor, attributes, colors[colorPos])
|
||||||
tagOffset += colorIndices[colorPos][1] - colorIndices[colorPos][0]
|
tagOffset += colorIndices[colorPos][1] - colorIndices[colorPos][0]
|
||||||
colorPos++
|
colorPos++
|
||||||
|
Loading…
x
Reference in New Issue
Block a user