zed-industries/zed · error
More than one cursor position match found
Error message
More than one cursor position match found
What it means
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.
Source
Thrown at crates/edit_prediction_cli/src/load_project.rs:191
example.spec.cursor_path.display()
)
})?;
project
.update(cx, |project, cx| project.open_buffer(cursor_path, cx))
.await?
};
let (cursor_excerpt, cursor_offset_within_excerpt) = example.spec.cursor_excerpt()?;
let excerpt_offset = cursor_buffer.read_with(&*cx, |buffer, _cx| {
let text = buffer.text();
let mut matches = text.match_indices(&cursor_excerpt);
let (excerpt_offset, _) = matches.next().with_context(|| {
format!("Cursor excerpt did not exist in buffer:\n\n{cursor_excerpt}\n",)
})?;
anyhow::ensure!(
matches.next().is_none(),
"More than one cursor position match found",
);
Ok(excerpt_offset)
})?;
let cursor_offset = excerpt_offset + cursor_offset_within_excerpt;
let cursor_anchor =
cursor_buffer.read_with(&*cx, |buffer, _| buffer.anchor_after(cursor_offset));
Ok((cursor_buffer, cursor_anchor))
}
async fn setup_project(
example: &mut Example,
app_state: &Arc<EpAppState>,
step_progress: &StepProgress,
cx: &mut AsyncApp,View on GitHub (pinned to f4178619ac)
Solutions
- Enlarge the cursor excerpt in the example spec so it is unique in the buffer
- Regenerate the example with a longer, unambiguous excerpt
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/edit_prediction_cli/src/load_project.rs:191 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/53d1fca8f78cd79d.
Report an issue: GitHub.