Skip to content

Commit

Permalink
fix refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Nov 30, 2024
1 parent 3c0078f commit 2647d54
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/textual/widgets/_option_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,7 @@ def _add_lines(

def _populate(self) -> None:
"""Populate the lines data-structure."""
if self._lines is not None:
return

self._lines = []
self._spans = []

Expand Down Expand Up @@ -825,6 +824,8 @@ def get_option_index(self, option_id: str) -> int:

def render_line(self, y: int) -> Strip:
assert self._lines is not None
if not self._lines:
self._populate()

_scroll_x, scroll_y = self.scroll_offset
line_number = scroll_y + y
Expand Down

0 comments on commit 2647d54

Please sign in to comment.