1
0
mirror of https://github.com/rivo/tview.git synced 2025-04-24 13:48:56 +08:00

Fixed disappearing highlights. Fixes #941

This commit is contained in:
Oliver 2024-01-20 10:50:12 +01:00
parent 742cf08619
commit 7568c3f71c

View File

@ -1048,17 +1048,15 @@ func (t *TextView) Draw(screen tcell.Screen) {
// Scroll to highlighted regions.
if t.regionTags && t.scrollToHighlights {
// Make sure we know all highlighted regions.
knownHighlights := make(map[string]struct{})
t.parseAhead(width, func(lineNumber int, line *textViewLine) bool {
for regionID := range t.highlights {
if _, ok := t.regions[regionID]; !ok {
return false
}
knownHighlights[regionID] = struct{}{}
t.highlights[regionID] = struct{}{}
}
return true
})
t.highlights = knownHighlights
// What is the line range for all highlighted regions?
var (