'Return True if cursor is before *position*'

def is_cursor_before(self, position, char_offset=0):

    position = (self.get_position(position) + char_offset)
    cursor = self.textCursor()
    cursor.movePosition(QTextCursor.End)
    if (position < cursor.position()):
        cursor.setPosition(position)
        return (self.textCursor() < cursor)
