{"record":{"id":"f741a793d66462d0","repo":"zed-industries/zed","slug":"failed-to-determine-buffer-and-selection","errorCode":null,"errorMessage":"failed to determine buffer and selection","messagePattern":"failed to determine buffer and selection","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/editor/src/git.rs","lineNumber":2922,"sourceCode":"\n            let buffer_range = range.to_point(buffer_snapshot);\n            let buffer = multi_buffer.buffer(buffer_snapshot.remote_id())?;\n\n            let Some(buffer_diff) = multi_buffer.diff_for(buffer_snapshot.remote_id()) else {\n                return Some((buffer, buffer_range.start.row..buffer_range.end.row));\n            };\n\n            let buffer_diff_snapshot = buffer_diff.read(cx).snapshot(cx);\n            let start = buffer_diff_snapshot\n                .buffer_point_to_base_text_point(buffer_range.start, &buffer_snapshot);\n            let end = buffer_diff_snapshot\n                .buffer_point_to_base_text_point(buffer_range.end, &buffer_snapshot);\n\n            Some((buffer, start.row..end.row))\n        });\n\n        let Some((buffer, selection)) = buffer_and_selection else {\n            return Task::ready(Err(anyhow!(\"failed to determine buffer and selection\")));\n        };\n\n        let Some(project) = self.project() else {\n            return Task::ready(Err(anyhow!(\"editor does not have project\")));\n        };\n\n        project.update(cx, |project, cx| {\n            project.get_permalink_to_line(&buffer, selection, cx)\n        })\n    }\n}\n\n#[cfg(test)]\nimpl Editor {\n    /// Returns the line range for the first diff review overlay, if one is active.\n    /// Returns (start_row, end_row) as physical line numbers in the underlying file.\n    pub(super) fn diff_review_line_range(&self, cx: &App) -> Option<(u32, u32)> {\n        let overlay = self.diff_review_overlays.first()?;","sourceCodeStart":2904,"sourceCodeEnd":2940,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/editor/src/git.rs#L2904-L2940","documentation":"The inline blame popover failed to resolve which buffer and row range the clicked blame belongs to. This is a generic guard inside the blame popover logic: the selection/diff mapping step (resolving buffer, buffer_diff, and base-text row translation) could not be completed, typically because the multi-buffer state changed between the popover opening and the click being handled.","triggerScenarios":"Thrown at crates/editor/src/git.rs:2922 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat as transient: re-resolve the buffer and selection from the current snapshot and retry once","Close/dismiss the popover gracefully with no action if the buffer no longer exists","Check that the editor snapshot used for resolution matches the one the popover was opened with"],"exampleFix":null,"handlingStrategy":"retry","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"}