MCPcopy Index your code
hub / github.com/python/cpython / find_selection

Method find_selection

Lib/idlelib/search.py:121–132  ·  view source on GitHub ↗

Search for selected text with previous dialog preferences. Instead of using the same pattern for searching (as Find Again does), this first resets the pattern to the currently selected text. If the selected text isn't changed, then use the prior search phrase.

(self, text)

Source from the content-addressed store, hash-verified

119 return False
120
121 def find_selection(self, text):
122 """Search for selected text with previous dialog preferences.
123
124 Instead of using the same pattern for searching (as Find
125 Again does), this first resets the pattern to the currently
126 selected text. If the selected text isn't changed, then use
127 the prior search phrase.
128 """
129 pat = text.get("sel.first", "sel.last")
130 if pat:
131 self.engine.setcookedpat(pat)
132 return self.find_again(text)
133
134
135def _search_dialog(parent): # htest #

Callers 3

find_selection_eventMethod · 0.80
find_selectionFunction · 0.80
test_find_selectionMethod · 0.80

Calls 3

find_againMethod · 0.95
setcookedpatMethod · 0.80
getMethod · 0.45

Tested by 1

test_find_selectionMethod · 0.64