From 63e8b4462993089f1067197f72bb55bec4ed14ef Mon Sep 17 00:00:00 2001 From: RumovZ Date: Sat, 30 Jan 2021 11:05:48 +0100 Subject: [PATCH] Update docstrings for browser search --- qt/aqt/browser.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index c7731d31a..40fd7695a 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -628,8 +628,11 @@ class Browser(QMainWindow): self.update_history() def search_for(self, search: str, prompt: Optional[str] = None) -> bool: - # keep track of search string so that we reuse identical search when - # refreshing, rather than whatever is currently in the search field + """Keep track of search string so that we reuse identical search when + refreshing, rather than whatever is currently in the search field. + Optionally set the search bar to a different text than the actual search. + """ + self._lastSearchTxt = search prompt = search if prompt == None else prompt self.form.searchEdit.lineEdit().setText(prompt) @@ -667,6 +670,8 @@ class Browser(QMainWindow): return selected def show_single_card(self, card: Optional[Card]) -> None: + """Try to search for the according note and select the given card.""" + nid = card and card.nid if nid: