Make operator highlighting configurable, disable it by default

This commit is contained in:
Lukas Wirth
2022-08-22 13:21:30 +02:00
parent 16315edaee
commit afc8cfb4d1
2 changed files with 24 additions and 2 deletions

View File

@@ -544,6 +544,12 @@ pub(crate) fn semantic_tokens(
tag @ HlTag::Punctuation(_) if !config.specialize_punctuation => {
*tag = HlTag::Punctuation(HlPunct::Other);
}
HlTag::Operator(_) if !config.operator && highlight_range.highlight.mods.is_empty() => {
continue
}
tag @ HlTag::Operator(_) if !config.specialize_operator => {
*tag = HlTag::Operator(HlOperator::Other);
}
_ => (),
}