{"record":{"id":"0eac86dd814c69f0","repo":"iced-rs/iced","slug":"cursor-line-should-be-present","errorCode":null,"errorMessage":"Cursor line should be present","messagePattern":"Cursor line should be present","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"graphics/src/text/editor.rs","lineNumber":201,"sourceCode":"                                } * (1.0 / internal.hint_factor),\n                            )\n                        } else {\n                            None\n                        }\n                    })\n                    .collect();\n\n                Selection::Range(regions)\n            }\n            _ => {\n                let line_height = buffer.metrics().line_height;\n\n                let visual_lines_offset = visual_lines_offset(cursor.line, buffer);\n\n                let line = buffer\n                    .lines\n                    .get(cursor.line)\n                    .expect(\"Cursor line should be present\");\n\n                let layout = line.layout_opt().expect(\"Line layout should be cached\");\n\n                let empty_offset = match internal.alignment {\n                    Alignment::Default | Alignment::Left | Alignment::Justified => 0.0,\n                    Alignment::Center => internal.bounds.width / 2.0,\n                    Alignment::Right => internal.bounds.width,\n                };\n\n                let (visual_line, offset) = layout\n                    .iter()\n                    .enumerate()\n                    .find_map(|(i, line)| {\n                        let (start, offset) = line\n                            .glyphs\n                            .first()\n                            .map(|glyph| (glyph.start, glyph.x))\n                            .unwrap_or((0, empty_offset));","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/iced-rs/iced/blob/2cffa99b395d84fe469b44dccb56bbacd2f1a157/graphics/src/text/editor.rs#L183-L219","documentation":"Error \"Cursor line should be present\" thrown in iced-rs/iced.","triggerScenarios":"Thrown at graphics/src/text/editor.rs:201 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2cffa99b395d84fe469b44dccb56bbacd2f1a157","analyzedAt":"2026-08-16T19:41:49.083Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}