From 959c937382bca0754fed41bb46695d9438655271 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 28 Jan 1999 19:04:01 +0000 Subject: [PATCH] When find_again() finds exactly the current selection, it's a failure. --- Tools/idle/SearchDialog.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tools/idle/SearchDialog.py b/Tools/idle/SearchDialog.py index 501b6d0067..0f0cb189f6 100644 --- a/Tools/idle/SearchDialog.py +++ b/Tools/idle/SearchDialog.py @@ -43,6 +43,14 @@ class SearchDialog(SearchDialogBase): i, j = m.span() first = "%d.%d" % (line, i) last = "%d.%d" % (line, j) + try: + selfirst = text.index("sel.first") + sellast = text.index("sel.last") + if selfirst == first and sellast == last: + text.bell() + return 0 + except TclError: + pass text.tag_remove("sel", "1.0", "end") text.tag_add("sel", first, last) text.mark_set("insert", self.engine.isback() and first or last) -- 2.50.1