mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07: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:
parent
ac36d272d3
commit
57c8677b5c
2 changed files with 7 additions and 0 deletions
|
@ -463,6 +463,8 @@ Editor::CodepointRange Editor::byte_offset_range_to_code_point_offset_range(size
|
|||
|
||||
void Editor::stylize(Span const& span, Style const& style)
|
||||
{
|
||||
if (!span.is_empty())
|
||||
return;
|
||||
if (style.is_empty())
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue