From 247cd65bb63e405b357b8347a93dca56b06f50cf Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 28 Mar 2024 13:54:35 +0100 Subject: [PATCH] Only update search for documents in current results --- novelwriter/gui/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/novelwriter/gui/search.py b/novelwriter/gui/search.py index 95ef15ea..d0aafe0b 100644 --- a/novelwriter/gui/search.py +++ b/novelwriter/gui/search.py @@ -237,7 +237,7 @@ class GuiProjectSearch(QWidget): @pyqtSlot(str, float) def textChanged(self, tHandle: str, timeStamp: float) -> None: """Update search result for a specific document.""" - if timeStamp > self._map.get(tHandle, (0, 0.0))[1]: + if (entry := self._map.get(tHandle)) and timeStamp > entry[1]: start = time() results, capped = self._search.searchText(SHARED.mainGui.docEditor.getText()) self._displayResultSet(SHARED.project.tree[tHandle], results, capped)