mirror of
https://github.com/rivo/tview.git
synced 2026-04-28 06:15:59 +03:00
[GH-ISSUE #1088] Posible textarea error #791
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#791
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 @manuecg on GitHub (Apr 16, 2025).
Original GitHub issue: https://github.com/rivo/tview/issues/1088
Hi, while checking the logs of my application, I noticed that sometimes I get the following error:
runtime error: index out of range [-1]
It seems the bug happens when the application has been running for a long time, so to try to reproduce it, I created an infinite loop that keeps setting values in an input field. I haven’t been able to reproduce the crash, but I did observe a behavior that doesn’t seem quite right…
This value keeps growing endlessly...
Is that behavior expected? Are you aware of the bug I’m referring to?
@rivo commented on GitHub (Apr 17, 2025):
github.com/inditex/cli-icarussaas/internal/ui/goroutinesis not a public repository and you didn't explain what that package does. But if you accessInputFieldfrom multiple goroutines, don't. See https://github.com/rivo/tview/wiki/Concurrency for details.And yes, the
spansslice keeps growing.TextArea(and thus,InputFieldtoo) comes with infinite undo/redo functionality. That slice keeps all the previous states. Under normal circumstances, this should not be a problem. But I don't know how long is "for a long time" in your case.If you want me to look into this panic, please provide code that I can run which reproduces the error. And I would prefer for it not to use any third-party libraries.
@manuecg commented on GitHub (Apr 22, 2025):
Ok, thanks for replying, I'll check the concurrency part, and if I can manage to reproduce it, then I'll share some code.
Thanks a lot!