|
|
|
@ -1019,7 +1019,14 @@ func (t *TextView) Draw(screen tcell.Screen) {
|
|
|
|
|
backgroundColor := index.BackgroundColor
|
|
|
|
|
attributes := index.Attributes
|
|
|
|
|
regionID := index.Region
|
|
|
|
|
if t.regions && regionID != "" && (len(t.regionInfos) == 0 || t.regionInfos[len(t.regionInfos)-1].ID != regionID) {
|
|
|
|
|
if t.regions {
|
|
|
|
|
if len(t.regionInfos) > 0 && t.regionInfos[len(t.regionInfos)-1].ID != regionID {
|
|
|
|
|
// End last region.
|
|
|
|
|
t.regionInfos[len(t.regionInfos)-1].ToX = x
|
|
|
|
|
t.regionInfos[len(t.regionInfos)-1].ToY = y + line - t.lineOffset
|
|
|
|
|
}
|
|
|
|
|
if regionID != "" && (len(t.regionInfos) == 0 || t.regionInfos[len(t.regionInfos)-1].ID != regionID) {
|
|
|
|
|
// Start a new region.
|
|
|
|
|
t.regionInfos = append(t.regionInfos, &textViewRegion{
|
|
|
|
|
ID: regionID,
|
|
|
|
|
FromX: x,
|
|
|
|
@ -1028,6 +1035,7 @@ func (t *TextView) Draw(screen tcell.Screen) {
|
|
|
|
|
ToY: -1,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Process tags.
|
|
|
|
|
colorTagIndices, colorTags, regionIndices, regions, escapeIndices, strippedText, _ := decomposeString(text, t.dynamicColors, t.regions)
|
|
|
|
|