diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index b43d5b1a2..e3ff7d7f2 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -188,6 +188,7 @@ class DataModel(QAbstractTableModel): ctx = SearchContext(search=txt, browser=self.browser) gui_hooks.browser_will_search(ctx) if ctx.card_ids is None: + ctx.search = self.browser.norm_search(ctx.search) ctx.card_ids = self.col.find_cards(ctx.search, order=ctx.order) gui_hooks.browser_did_search(ctx) self.cards = ctx.card_ids @@ -818,6 +819,12 @@ class Browser(QMainWindow): # no row change will fire self._onRowChanged(None, None) + def norm_search(self, search: str) -> str: + normed = self.col.backend.norm_search(search) + self._lastSearchTxt = normed + self.form.searchEdit.lineEdit().setText(normed) + return normed + def updateTitle(self): selected = len(self.form.tableView.selectionModel().selectedRows()) cur = len(self.model.cards)