def _edit_command_and_flag(is_split, is_vertical, is_tab, force_edit):
    """
        Return the command and flags to use in the `edit' procedure.

        is_split:       The command must execute a split window
        is_vertical:    if `is_split' is set, the vertical `flags' will be set
        is_tab:         If `is_split' is not set, command must execute a new
                        tab
        force_edit:     if `is_split' and `is_tab' are not set, command must
                        overrite the current window content event if it is
                        modified.

        Return:         a tuple containing the appropriete command and flags.
    """
    flags = ""
    if is_split:
        command = "split"
        if is_vertical:
            flags = "vertical"
    elif is_tab:
        command = "tabedit"
    else:
        command = "edit"
        if force_edit:
            command = command + "!"
    return (command, flags)