Add search_for method

This commit is contained in:
Henrik Giesel 2020-10-19 20:37:17 +02:00
parent 06292a45f3
commit 2d65e81b13

View File

@ -794,6 +794,11 @@ class Browser(QMainWindow):
self._lastSearchTxt = txt
self.search()
def search_for(self, search: str, prompt: Optional[str] = None) -> None:
self._lastSearchTxt = search
self.form.searchEdit.lineEdit().setText(prompt or search)
self.search()
# search triggered programmatically. caller must have saved note first.
def search(self) -> None:
if "is:current" in self._lastSearchTxt: