(self, first, last)
Highlight text between first and last indices.

        Text is highlighted via the 'hit' tag and the marked
        section is brought into view.

        The colors from the 'hit' tag aren't currently shown
        when the text is displayed.  This is due to the 'sel'
        tag being added first, so the colors in the 'sel'
        config are seen instead of the colors for 'hit'.
Highlight text between first and last indices.
Highlight text between first and last indices .
def show_hit(self, first, last):
        """Highlight text between first and last indices.

        Text is highlighted via the 'hit' tag and the marked
        section is brought into view.

        The colors from the 'hit' tag aren't currently shown
        when the text is displayed.  This is due to the 'sel'
        tag being added first, so the colors in the 'sel'
        config are seen instead of the colors for 'hit'.
        """
        text = self.text
        text.mark_set("insert", first)
        text.tag_remove("sel", "1.0", "end")
        text.tag_add("sel", first, last)
        text.tag_remove("hit", "1.0", "end")
        if first == last:
            text.tag_add("hit", first)
        else:
            text.tag_add("hit", first, last)
        text.see("insert")
        text.update_idletasks()
def show_hit ( self , first , last ) : text = self . text text . mark_set ( "insert" , first ) text . tag_remove ( "sel" , "1.0" , "end" ) text . tag_add ( "sel" , first , last ) text . tag_remove ( "hit" , "1.0" , "end" ) if first == last : text . tag_add ( "hit" , first ) else : text . tag_add ( "hit" , first , last ) text . see ( "insert" ) text . update_idletasks ( )