zed-industries/zed · warning · ValueError

archive member escapes destination

Error message

archive member escapes destination: {member.name}

What it means

When an ex command resolves a range/address like :'a,'b, vim resolves Position::Mark by looking the mark up via vim.get_mark in the current buffer. If no mark with that name was ever set (or it is not a local mark), the lookup returns None and the command fails with 'mark {name} not set'.

Solutions

  1. Set the mark first in normal mode (e.g. ma) and re-run the command
  2. Substitute a line number or another already-set mark for the missing one
  3. Run :marks to list which marks currently exist before using them in a range

Example fix

" before
:'a,'b sort   " E: mark a not set

" after
ma              " set mark a at cursor
:'a,'b sort
Defensive patterns

Strategy: validation

Validate before calling

// In a vim plugin/wrapper, check the mark before running a mark-addressed command:
if !matches!(vim.get_mark(&name.to_string(), editor, window, cx), Some(Mark::Local(anchors)) if !anchors.is_empty()) {
    set_status("Mark {name} not set — press m{name} first");
    return;
}

Type guard

fn mark_is_resolvable(
    vim: &Vim,
    name: char,
    editor: &Editor,
    window: &mut Window,
    cx: &mut Context<Vim>,
) -> bool {
    matches!(
        vim.get_mark(&name.to_string(), editor, window, cx),
        Some(Mark::Local(anchors)) if !anchors.is_empty()
    )
}

Try / catch

match parse_and_run_range("'a,'b", editor, vim, window, cx) {
    Err(err) if err.to_string().contains("mark") => {
        set_status(&format!("{err}; run :marks to see available marks"));
    }
    result => result,
}

Prevention

When it happens

Trigger: Using an ex command whose range references a mark that was never set in this window/buffer: :'a,'b sort or :d 'a before pressing ma; marks are Mark::Local, so marks set in another buffer do not resolve here; marks cleared by a buffer reload/restart also trigger it.

Common situations: Typing a mark range before setting the marks; expecting uppercase/file marks to behave as local marks; the buffer was reloaded (git checkout, format-on-save rollback) invalidating marks; following a vim tutorial whose marks were never created.

Related errors


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/11fb763fb671d021. Report an issue: GitHub.

Appendix: source

Thrown at crates/eval_cli/zed_eval/common.py:51


def load_json(path: pathlib.Path) -> dict[str, Any] | None:
    try:
        data = json.loads(path.read_text())
    except (OSError, json.JSONDecodeError):
        return None
    return data if isinstance(data, dict) else None


def safe_extract_archive(archive: tarfile.TarFile, destination: pathlib.Path) -> None:
    destination = destination.resolve()
    members = archive.getmembers()
    for member in members:
        if member.issym() or member.islnk():
            raise ValueError(f"archive links are not supported: {member.name}")
        target = (destination / member.name).resolve()
        if destination != target and destination not in target.parents:
            raise ValueError(f"archive member escapes destination: {member.name}")
    archive.extractall(destination, members=members)


def command_exists(name: str) -> bool:
    return shutil.which(name) is not None


def run_command(
    command: list[str], *, capture: bool = False
) -> subprocess.CompletedProcess[str]:
    return subprocess.run(command, check=True, text=True, capture_output=capture)


def dedupe_preserving_order(values: list[str]) -> list[str]:
    seen = set()
    result = []
    for value in values:
        if value in seen:

View on GitHub (pinned to f4178619ac)