Anchors the text cursor position.

    :param object: Object to decorate.
    :type object: object
    :return: Object.
    :rtype: object

def anchor_text_cursor(object):
    """
    Anchors the text cursor position.

    :param object: Object to decorate.
    :type object: object
    :return: Object.
    :rtype: object
    """

    @functools.wraps(object)
    def anchor_text_cursorWrapper(*args, **kwargs):
        """
        Anchors the text cursor position.

        :param \*args: Arguments.
        :type \*args: \*
        :param \*\*kwargs: Keywords arguments.
        :type \*\*kwargs: \*\*
        :return: Object.
        :rtype: object
        """

        if args:
            if hasattr(foundations.common.get_first_item(args), "store_text_cursor_anchor"):
                foundations.common.get_first_item(args).store_text_cursor_anchor()

        value = object(*args, **kwargs)

        if args:
            if hasattr(foundations.common.get_first_item(args), "restore_text_cursor_anchor"):
                foundations.common.get_first_item(args).store_text_cursor_anchor()

        return value

    return anchor_text_cursorWrapper