Fix TextView.GetRegionText error when text contains color tags

Resolves #69.
This commit is contained in:
Trevor Slocum 2021-07-12 13:21:13 -07:00
parent 9c993d8c7e
commit f794cceb95
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,6 @@
v1.5.7 (WIP)
- Fix TextView.GetRegionText error when text contains color tags
v1.5.6 (2020-07-08)
- Add TrueColorTags option and do not use TrueColor tag values by default
- Add TextView.SetHighlightForegroundColor and TextView.SetHighlightBackgroundColor

View File

@ -697,6 +697,9 @@ func (t *TextView) GetRegionText(regionID string) string {
if currentTag < len(colorTagIndices) && pos >= colorTagIndices[currentTag][0] && pos < colorTagIndices[currentTag][1] {
if pos == colorTagIndices[currentTag][1]-1 {
currentTag++
if currentTag == len(colorTagIndices) {
continue
}
}
if colorTagIndices[currentTag][1]-colorTagIndices[currentTag][0] > 2 {
continue