editor: Fix adjacent custom highlights interfering with each other (#37912)

Release Notes:

- Fixed matching bracket highlighting not highlighting closing brackets
when adjacent to each other

Co-authored-by: Finn Evers <finn@zed.dev>
This commit is contained in:
Lukas Wirth
2025-09-10 13:08:32 +00:00
committed by GitHub
co-authored by Finn Evers
parent fcdd427cf8
commit df2d097dc5
2 changed files with 15 additions and 13 deletions
+2 -2
View File
@@ -2609,7 +2609,7 @@ pub mod tests {
);
language.set_theme(&theme);
let (text, highlighted_ranges) = marked_text_ranges(r#"constˇ «a»: B = "c «d»""#, false);
let (text, highlighted_ranges) = marked_text_ranges(r#"constˇ «a»«:» B = "c «d»""#, false);
let buffer = cx.new(|cx| Buffer::local(text, cx).with_language(language, cx));
cx.condition(&buffer, |buf, _| !buf.is_parsing()).await;
@@ -2658,7 +2658,7 @@ pub mod tests {
[
("const ".to_string(), None, None),
("a".to_string(), None, Some(Hsla::blue())),
(":".to_string(), Some(Hsla::red()), None),
(":".to_string(), Some(Hsla::red()), Some(Hsla::blue())),
(" B = ".to_string(), None, None),
("\"c ".to_string(), Some(Hsla::green()), None),
("d".to_string(), Some(Hsla::green()), Some(Hsla::blue())),