Closed shigeyukey closed 3 months ago
If no card is available, return it.
# browser.py
def on_browser_did_change_row(
browser: Browser, current: Optional[int] = None, previous: Optional[int] = None
):
"""
Highlight cloze deletions in Editor pane on selecting a cloze card
"""
selected_cards = browser.selected_cards() # add
if not selected_cards: # add
return # add
card_id = browser.selected_cards()[0]
card = mw.col.get_card(card_id)
note = card.note()