mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #751] Textview can't get GetRegionText with colored content and panics #550
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#550
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sruehl on GitHub (Aug 3, 2022).
Original GitHub issue: https://github.com/rivo/tview/issues/751
There is a guard to only check if the current tag
currentTaghas a index incolorTagIndices:github.com/rivo/tview@711ef394f9/textview.go (L623)when it hits the end tag it increments the
currentTaggithub.com/rivo/tview@711ef394f9/textview.go (L625)and then produces a panic in the next line because the new tag is not bound checked against
colorTagIndicesgithub.com/rivo/tview@711ef394f9/textview.go (L627)@sruehl commented on GitHub (Aug 3, 2022):
so from my understanding that would be solved by changing 627 to
if currentTag < len(colorTagIndices) && colorTagIndices[currentTag][1]-colorTagIndices[currentTag][0] > 2 {