mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #67] presentation demo, crash on table #47
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#47
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 @glycerine on GitHub (Mar 9, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/67
tviewlooks fantastic. Thank you immensely for making this.I was playing with the demos/presentation app. On the (8) table tab, inside (n) navigation,
if I use the down arrow key to scroll all the way to the bottom of the table, and then use the right arrow key to scroll all the way to the right, I seem to make it reliably crash.
@glycerine commented on GitHub (Mar 9, 2018):
Seems to depend upon having the screen at a particular size though. If I expand the screen after the crash (with zoomed in screen, not alot of text), I can see that it is an index out of range error.
@glycerine commented on GitHub (Mar 10, 2018):
at https://github.com/rivo/tview/blob/master/table.go#L626
when I log the index and widths, the crash happens when:
widths ='[]int{10, 9, 9}', len(widths)=3, index=3the relevant portion of table.go
indexis indeed out of bounds.@glycerine commented on GitHub (Mar 10, 2018):
at slightly bigger zoom (fewer rows/columns on the screen), I print the expansions slice to see it after a crash:
so
indexmight go up to 6 here, but widths is only length 2.@rivo commented on GitHub (Mar 10, 2018):
Thank you for pointing this out. I just committed a fix to this.
I'm closing your pull request because the solution was not to check the bounds of the
widthsvariable but to keep theexpansionsslice the same length aswidths. They need to be in sync but I had forgotten to remove an element when removing an element fromwidths. (Your commit would have led to other problems down the line.)But thanks again for taking the time to look into this.