def groups_on_preview(window) :
    """
    Retrun group number of dired(active) and preview.
    """
    groups = window.num_groups()
    active_group = window.active_group()

    # Usually, preview group is made the right side of dired(active) group.
    if active_group < groups - 1 or groups == 1 :
        return [active_group, active_group + 1]

    # If the dired(active) group is the rightmost of window,
    # preview group is made the left side of it.
    else :
        return [active_group, active_group - 1]