1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 00:15:07 +00:00

Spreadsheet: Highlight the source causing an exception in red

This commit makes the cell editor highlight the likely source of the
exception in red.
This commit is contained in:
AnotherTest 2020-12-28 20:46:39 +03:30 committed by Andreas Kling
parent b34b681811
commit aa5b43a2bc
3 changed files with 21 additions and 0 deletions

View file

@ -53,6 +53,19 @@ void CellSyntaxHighlighter::rehighlight(Gfx::Palette palette)
false,
false,
nullptr);
if (m_cell && m_cell->exception()) {
auto range = m_cell->exception()->source_ranges().first();
GUI::TextRange text_range { { range.start.line - 1, range.start.column }, { range.end.line - 1, range.end.column - 1 } };
m_editor->document().spans().prepend({ text_range,
Color::Black,
Color::Red,
false,
false,
false,
nullptr });
}
m_editor->update();
}
CellSyntaxHighlighter::~CellSyntaxHighlighter()