1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +00:00

LibLine: Ignore empty spans when stylizing

Previously we would erroneously apply the stylization to the whoever
called stylize next. Now we first check whether the span is non-empty
before stylizing. All non-empty spans must have at least one character
in them (end-exclusive).
This commit is contained in:
sin-ack 2022-07-16 23:37:03 +00:00 committed by Ali Mohammad Pur
parent ac36d272d3
commit 57c8677b5c
2 changed files with 7 additions and 0 deletions

View file

@ -28,6 +28,11 @@ public:
size_t end() const { return m_end; }
Mode mode() const { return m_mode; }
bool is_empty() const
{
return m_beginning < m_end;
}
private:
size_t m_beginning { 0 };
size_t m_end { 0 };