def toggle_caption(indicate_saved):
    """Toggle caption to indicate saved/unsaved state.

    That is, to indicate whether there are changes in the
    positions which aren't saved on file.

    indicate_saved (boolean)
        hints to whether or not we should indicate that
        changes made are saved.
    """
    title, icontitle = get_caption()

    ### remove asterisk

    if indicate_saved:

        if not are_changes_saved():

            title = title[1:]
            icontitle = icontitle[1:]

    ### add asterisk

    else:

        if are_changes_saved():

            title = "*" + title
            icontitle = "*" + icontitle

    ### set the caption using the resulting
    ### title and icontitle
    set_caption(title, icontitle)
Toggle caption to indicate saved/unsaved state.

    That is, to indicate whether there are changes in the
    positions which aren't saved on file.

    indicate_saved (boolean)
        hints to whether or not we should indicate that
        changes made are saved.
    
nodezator/our3rdlibs/behaviour.py