{"record":{"id":"90b0ae120b7f3ab5","repo":"iced-rs/iced","slug":"line-layout-should-be-cached","errorCode":null,"errorMessage":"Line layout should be cached","messagePattern":"Line layout should be cached","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"graphics/src/text/editor.rs","lineNumber":203,"sourceCode":"                        } 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));\n\n                        let end = line.glyphs.last().map(|glyph| glyph.end).unwrap_or(0);","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/iced-rs/iced/blob/2cffa99b395d84fe469b44dccb56bbacd2f1a157/graphics/src/text/editor.rs#L185-L221","documentation":"Error \"Line layout should be cached\" thrown in iced-rs/iced.","triggerScenarios":"Thrown at graphics/src/text/editor.rs:203 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"}