{"record":{"id":"11fb763fb671d021","repo":"zed-industries/zed","slug":"archive-member-escapes-destination-member-name","errorCode":null,"errorMessage":"archive member escapes destination: {member.name}","messagePattern":"archive member escapes destination: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"crates/eval_cli/zed_eval/common.py","lineNumber":51,"sourceCode":"\n\ndef load_json(path: pathlib.Path) -> dict[str, Any] | None:\n    try:\n        data = json.loads(path.read_text())\n    except (OSError, json.JSONDecodeError):\n        return None\n    return data if isinstance(data, dict) else None\n\n\ndef safe_extract_archive(archive: tarfile.TarFile, destination: pathlib.Path) -> None:\n    destination = destination.resolve()\n    members = archive.getmembers()\n    for member in members:\n        if member.issym() or member.islnk():\n            raise ValueError(f\"archive links are not supported: {member.name}\")\n        target = (destination / member.name).resolve()\n        if destination != target and destination not in target.parents:\n            raise ValueError(f\"archive member escapes destination: {member.name}\")\n    archive.extractall(destination, members=members)\n\n\ndef command_exists(name: str) -> bool:\n    return shutil.which(name) is not None\n\n\ndef run_command(\n    command: list[str], *, capture: bool = False\n) -> subprocess.CompletedProcess[str]:\n    return subprocess.run(command, check=True, text=True, capture_output=capture)\n\n\ndef dedupe_preserving_order(values: list[str]) -> list[str]:\n    seen = set()\n    result = []\n    for value in values:\n        if value in seen:","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/eval_cli/zed_eval/common.py#L33-L69","documentation":"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'.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set the mark first in normal mode (e.g. ma) and re-run the command","Substitute a line number or another already-set mark for the missing one","Run :marks to list which marks currently exist before using them in a range"],"exampleFix":"\" before\n:'a,'b sort   \" E: mark a not set\n\n\" after\nma              \" set mark a at cursor\n:'a,'b sort","handlingStrategy":"validation","validationCode":"// In a vim plugin/wrapper, check the mark before running a mark-addressed command:\nif !matches!(vim.get_mark(&name.to_string(), editor, window, cx), Some(Mark::Local(anchors)) if !anchors.is_empty()) {\n    set_status(\"Mark {name} not set — press m{name} first\");\n    return;\n}","typeGuard":"fn mark_is_resolvable(\n    vim: &Vim,\n    name: char,\n    editor: &Editor,\n    window: &mut Window,\n    cx: &mut Context<Vim>,\n) -> bool {\n    matches!(\n        vim.get_mark(&name.to_string(), editor, window, cx),\n        Some(Mark::Local(anchors)) if !anchors.is_empty()\n    )\n}","tryCatchPattern":"match parse_and_run_range(\"'a,'b\", editor, vim, window, cx) {\n    Err(err) if err.to_string().contains(\"mark\") => {\n        set_status(&format!(\"{err}; run :marks to see available marks\"));\n    }\n    result => result,\n}","preventionTips":["Run :marks before using mark ranges to confirm the marks exist in this buffer","Set marks immediately before the command that consumes them, in the same buffer session","Remember local (lowercase) marks do not transfer across files — use line numbers in cross-buffer workflows"],"tags":["vim","mark","ex-command","range"],"backgroundTag":"vim-mark-unset","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}