Skip to content

Commit

Permalink
make cursor coord unpacking consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
TomJGooding committed Jan 14, 2024
1 parent 80a5f08 commit 2cd2fd6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/textual/widgets/_month_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def _on_datatable_cell_highlighted(
date_coordinate = self._get_date_coordinate(self.date)
table.cursor_coordinate = date_coordinate
else:
row, column = event.coordinate
highlighted_date = self._calendar_dates[row][column]
cursor_row, cursor_column = event.coordinate
highlighted_date = self._calendar_dates[cursor_row][cursor_column]
assert isinstance(highlighted_date, datetime.date)
self.date = highlighted_date
self.post_message(MonthCalendar.DateHighlighted(self, self.date))
Expand Down Expand Up @@ -250,8 +250,7 @@ def watch_date(self, old_date: datetime.date, new_date: datetime.date) -> None:
self._update_calendar_table(update_week_header=False)
else:
table = self.query_one(DataTable)
cursor_row = table.cursor_coordinate.row
cursor_column = table.cursor_coordinate.column
cursor_row, cursor_column = table.cursor_coordinate
if self._calendar_dates[cursor_row][cursor_column] != new_date:
date_coordinate = self._get_date_coordinate(self.date)
table.cursor_coordinate = date_coordinate
Expand Down

0 comments on commit 2cd2fd6

Please sign in to comment.