mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-01 19:58:12 +03:00
Avoid looking up ui.text per highlight range
This commit is contained in:
parent
557fd86e71
commit
5f8b1c7320
@ -288,6 +288,8 @@ impl EditorView {
|
||||
let tab_width = doc.tab_width();
|
||||
let tab = " ".repeat(tab_width);
|
||||
|
||||
let text_style = theme.get("ui.text");
|
||||
|
||||
'outer: for event in highlights {
|
||||
match event {
|
||||
HighlightEvent::HighlightStart(span) => {
|
||||
@ -304,7 +306,7 @@ impl EditorView {
|
||||
|
||||
use helix_core::graphemes::{grapheme_width, RopeGraphemes};
|
||||
|
||||
let style = spans.iter().fold(theme.get("ui.text"), |acc, span| {
|
||||
let style = spans.iter().fold(text_style, |acc, span| {
|
||||
let style = theme.get(theme.scopes()[span.0].as_str());
|
||||
acc.patch(style)
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user