mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
When find_again() finds exactly the current selection, it's a failure.
This commit is contained in:
parent
3d58bcd5d9
commit
959c937382
1 changed files with 8 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue