'Scroll to the specified line number'

def scroll_to_line(self, line_number):

    try:
        line_num = (int(line_number) - 1)
    except ValueError:
        return
    self.numbers.set_highlighted(line_num)
    cursor = self.textCursor()
    cursor.setPosition(0)
    self.setTextCursor(cursor)
    self.ensureCursorVisible()
    cursor.movePosition(cursor.Down, cursor.MoveAnchor, line_num)
    cursor.movePosition(cursor.EndOfLine, cursor.KeepAnchor)
    self.setTextCursor(cursor)
    self.ensureCursorVisible()
    scrollbar = self.verticalScrollBar()
    step = (scrollbar.pageStep() // 2)
    position = (scrollbar.sliderPosition() + step)
    scrollbar.setSliderPosition(position)
    self.ensureCursorVisible()
