(self, event=None)
Show clicked context line at top of editor.

        If a selection was made, don't jump; allow copying.
        If no visible context, show the top line of the file.
Show clicked context line at top of editor.
Show clicked context line at top of editor .
def jumptoline(self, event=None):
        """ Show clicked context line at top of editor.

        If a selection was made, don't jump; allow copying.
        If no visible context, show the top line of the file.
        """
        try:
            self.context.index("sel.first")
        except TclError:
            lines = len(self.info)
            if lines == 1:  # No context lines are showing.
                newtop = 1
            else:
                # Line number clicked.
                contextline = int(float(self.context.index('insert')))
                # Lines not displayed due to maxlines.
                offset = max(1, lines - self.context_depth) - 1
                newtop = self.info[offset + contextline][0]
            self.text.yview(f'{newtop}.0')
            self.update_code_context()
def jumptoline ( self , event = None ) : try : self . context . index ( "sel.first" ) except TclError : lines = len ( self . info ) if lines == 1 : # No context lines are showing. newtop = 1 else : # Line number clicked. contextline = int ( float ( self . context . index ( 'insert' ) ) ) # Lines not displayed due to maxlines. offset = max ( 1 , lines - self . context_depth ) - 1 newtop = self . info [ offset + contextline ] [ 0 ] self . text . yview ( f'{newtop}.0' ) self . update_code_context ( )