'Get offset in character for the given subject from the start of
text edit area'

def get_position(self, subject):

    cursor = self.textCursor()
    if (subject == 'cursor'):
        pass
    elif (subject == 'sol'):
        cursor.movePosition(QTextCursor.StartOfBlock)
    elif (subject == 'eol'):
        cursor.movePosition(QTextCursor.EndOfBlock)
    elif (subject == 'eof'):
        cursor.movePosition(QTextCursor.End)
    elif (subject == 'sof'):
        cursor.movePosition(QTextCursor.Start)
    else:
        return subject
    return cursor.position()
