added semi working highlight for reverser search

This commit is contained in:
Mikael Fangel 2023-04-02 00:07:58 +02:00 committed by Maas Lalani
parent 0d932a8efa
commit e804267b1e
No known key found for this signature in database
GPG key ID: 5A6ED5CBF1A0A000

View file

@ -122,7 +122,7 @@ func (s *search) PrevMatch(m *model) {
}
// Highliht the current match.
//m.content = m.content[:i - len(nextMatch) -1] + m.matchHighlightStyle.Render(nextMatch) + m.content[i + len(nextMatch) -1:]
m.content = m.content[:i] + strings.Replace(m.content[i:], nextMatch, m.matchHighlightStyle.Render(nextMatch), 1)
// Update the postion of the last found match.
for i = 0; s.query.FindString(m.content[i:s.lastMatchLoc]) != ""; i++ {