#NEWLINE# def _selected_line_changed( self ) : #NEWLINE# #INDENT# ' Handles a change in which line is currently selected.\n        ' #NEWLINE# line = self . selected_line #NEWLINE# control = self . control #NEWLINE# line = ( max ( 1 , min ( control . GetLineCount ( ) , line ) ) - 1 ) #NEWLINE# control . MarkerDeleteAll ( SELECTED_MARKER ) #NEWLINE# control . MarkerAdd ( line , SELECTED_MARKER ) #NEWLINE# control . GotoLine ( line ) #NEWLINE# if self . factory . auto_scroll : #NEWLINE# #INDENT# control . ScrollToLine ( ( line - ( control . LinesOnScreen ( ) / 2 ) ) ) #NEWLINE# #UNINDENT# control . Refresh ( )