class_docstr: Dialog for finding a pattern in text.
docstr: 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.
docstr_tok: ["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","is","n't","changed",",","then","use","the","prior","search","phrase","."]
code: def find_selection(self, text):
      """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.
      """
      pat = text.get("sel.first", "sel.last")
      if pat:
          self.engine.setcookedpat(pat)
      return self.find_again(text)
  
file_path: cpython/Lib/idlelib/search.py
imports: from tkinter import TclError
  from idlelib import searchengine
  from idlelib.searchbase import SearchDialogBase
label_desc: Use image node_id 4 for calling the SearchDialog obj's underlying member method code with example usage: obj.find_selection(text) and returns: self