A simple CPU rendered GUI IDE experience.
Diffstat (limited to 'src/text/semantic_tokens.rs')
-rw-r--r--src/text/semantic_tokens.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/text/semantic_tokens.rs b/src/text/semantic_tokens.rs
index ff8f9e5..33c1eb5 100644
--- a/src/text/semantic_tokens.rs
+++ b/src/text/semantic_tokens.rs
@@ -102,6 +102,7 @@ use crate::text::TextArea;
Copy, Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize,
)]
pub struct TokenD {
+ pub range: (u32, u32),
pub ty: u32,
pub modifiers: u32,
}
@@ -178,14 +179,12 @@ impl TextArea {
}) else {
continue;
};
-
- self.tokens.insert(
- x1..x2,
- TokenD {
- ty: t.token_type,
- modifiers: t.token_modifiers_bitset,
- },
- );
+ self.tokens.push(TokenD {
+ range: (x1, x2),
+ ty: t.token_type,
+ modifiers: t.token_modifiers_bitset,
+ });
}
+ // tokens are sorted by definition
}
}