Avoid spurious highlight runs in Language::highlight_text

This commit is contained in:
Max Brunsfeld 2022-04-22 13:13:54 -07:00
parent d330f909e6
commit 03d7035630
2 changed files with 7 additions and 1 deletions

View file

@ -546,7 +546,9 @@ impl Language {
{
let end_offset = offset + chunk.text.len();
if let Some(highlight_id) = chunk.syntax_highlight_id {
result.push((offset..end_offset, highlight_id));
if !highlight_id.is_default() {
result.push((offset..end_offset, highlight_id));
}
}
offset = end_offset;
}