def generate_completions(event):
    """
    Tab-completion: where the first tab completes the common suffix and the
    second tab lists all the completions.
    """
    b = event.current_buffer
    if b.complete_state:
        b.complete_next()
    else:
        b.start_completion(insert_common_part=True)
