on master help sign in
Avoid looking up ui.text per highlight range
commit5f8b1c7320f44985297eb483aa3a6c61f592d571 authorBlaž Hrastnik <blaz@mxxn.io> dateThu 19 Aug 2021, 15:59 (5 years ago) parent557fd86
1 file changed+3−1
helix-term/src/ui/editor.rs+3−1
helix-term/src/ui/editor.rs+3−1
@@ -288,6 +288,8 @@ impl EditorView {
288288 let tab_width = doc.tab_width();
289289 let tab = " ".repeat(tab_width);
290290
291+ let text_style = theme.get("ui.text");
292+
291293 'outer: for event in highlights {
292294 match event {
293295 HighlightEvent::HighlightStart(span) => {
@@ -304,7 +306,7 @@ impl EditorView {
304306
305307 use helix_core::graphemes::{grapheme_width, RopeGraphemes};
306308
307− let style = spans.iter().fold(theme.get("ui.text"), |acc, span| {
309+ let style = spans.iter().fold(text_style, |acc, span| {
308310 let style = theme.get(theme.scopes()[span.0].as_str());
309311 acc.patch(style)
310312 });