{"record":{"id":"53d1fca8f78cd79d","repo":"zed-industries/zed","slug":"more-than-one-cursor-position-match-found","errorCode":null,"errorMessage":"More than one cursor position match found","messagePattern":"More than one cursor position match found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/load_project.rs","lineNumber":191,"sourceCode":"                    example.spec.cursor_path.display()\n                )\n            })?;\n\n        project\n            .update(cx, |project, cx| project.open_buffer(cursor_path, cx))\n            .await?\n    };\n\n    let (cursor_excerpt, cursor_offset_within_excerpt) = example.spec.cursor_excerpt()?;\n\n    let excerpt_offset = cursor_buffer.read_with(&*cx, |buffer, _cx| {\n        let text = buffer.text();\n\n        let mut matches = text.match_indices(&cursor_excerpt);\n        let (excerpt_offset, _) = matches.next().with_context(|| {\n            format!(\"Cursor excerpt did not exist in buffer:\\n\\n{cursor_excerpt}\\n\",)\n        })?;\n        anyhow::ensure!(\n            matches.next().is_none(),\n            \"More than one cursor position match found\",\n        );\n        Ok(excerpt_offset)\n    })?;\n\n    let cursor_offset = excerpt_offset + cursor_offset_within_excerpt;\n    let cursor_anchor =\n        cursor_buffer.read_with(&*cx, |buffer, _| buffer.anchor_after(cursor_offset));\n\n    Ok((cursor_buffer, cursor_anchor))\n}\n\nasync fn setup_project(\n    example: &mut Example,\n    app_state: &Arc<EpAppState>,\n    step_progress: &StepProgress,\n    cx: &mut AsyncApp,","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/load_project.rs#L173-L209","documentation":"cursor_position searches the cursor buffer's text for occurrences of the expected cursor excerpt and requires exactly one match; more than one match makes the cursor position ambiguous, so example loading aborts rather than guessing.","triggerScenarios":"Thrown at crates/edit_prediction_cli/src/load_project.rs:191 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enlarge the cursor excerpt in the example spec so it is unique in the buffer","Regenerate the example with a longer, unambiguous excerpt"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}