(self)
handles caret position changed signal
handles caret position changed signal
handles caret position changed signal
def caret_pos_changed(self):
        """ handles caret position changed signal
        """
        # scroll to new pos if needed
        line = self.index_to_line(self.caret.position)
        scroll_y = self.verticalScrollBar().value()
        if line >= (scroll_y + self.visible_lines()):
            self.verticalScrollBar().setValue(line
                                              - (self.visible_lines() - 1))
        if line < scroll_y:
            self.verticalScrollBar().setValue(line)

        self._force_repaint()
def caret_pos_changed ( self ) : # scroll to new pos if needed line = self . index_to_line ( self . caret . position ) scroll_y = self . verticalScrollBar ( ) . value ( ) if line >= ( scroll_y + self . visible_lines ( ) ) : self . verticalScrollBar ( ) . setValue ( line - ( self . visible_lines ( ) - 1 ) ) if line < scroll_y : self . verticalScrollBar ( ) . setValue ( line ) self . _force_repaint ( )