'Go to the previous cell of lines'

def go_to_previous_cell(self):

    cursor = self.textCursor()
    cur_pos = prev_pos = cursor.position()
    if self.is_cell_separator(cursor):
        cursor.movePosition(QTextCursor.PreviousBlock)
        cur_pos = prev_pos = cursor.position()
    while (not self.is_cell_separator(cursor)):
        cursor.movePosition(QTextCursor.PreviousBlock)
        prev_pos = cur_pos
        cur_pos = cursor.position()
        if (cur_pos == prev_pos):
            return
    self.setTextCursor(cursor)
