Skip to content

Bug when changing sets #7

@Yokto13

Description

@Yokto13

What?

Weird index error when changing between sets. Happens probably quite rarely when one set is much longer the the other.

Reproduce:

Use the sets provided in the repo by default. Create a new set with just one pack with one question. Go to set: site, pack: web_otazky.csv then change to the new set. It should crash with some tui related index error.

The result after crash:

Traceback (most recent call last):
  File "/home/arklez/codes/Git/sphinx/main_tui.py", line 233, in <module>
    res = main_loop()
  File "/home/arklez/codes/Git/sphinx/main_tui.py", line 70, in main_loop
    res = d.handle_input(key)
  File "/home/arklez/codes/Git/sphinx/venv/lib/python3.10/site-packages/picotui/basewidget.py", line 66, in handle_input
    res = self.handle_mouse(inp[0], inp[1])
  File "/home/arklez/codes/Git/sphinx/venv/lib/python3.10/site-packages/picotui/widgets.py", line 142, in handle_mouse
    return w.handle_mouse(x, y)
  File "/home/arklez/codes/Git/sphinx/venv/lib/python3.10/site-packages/picotui/widgets.py", line 322, in handle_mouse
    self.signal("changed")
  File "/home/arklez/codes/Git/sphinx/venv/lib/python3.10/site-packages/picotui/basewidget.py", line 28, in signal
    self.signals[sig](self)
  File "/home/arklez/codes/Git/sphinx/main_tui.py", line 165, in w_listbox_changed
    pack_listbox.redraw()
  File "/home/arklez/codes/Git/sphinx/venv/lib/python3.10/site-packages/picotui/editor.py", line 61, in redraw
    self.show_line(self.content[i], i)
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions