aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-08-19 06:59:08 +0000
committerBlaž Hrastnik2021-08-19 06:59:08 +0000
commit5f8b1c7320f44985297eb483aa3a6c61f592d571 (patch)
tree93552ebaf68d28f1845c03dfa8df756208c554b6 /helix-term
parent557fd86e71062a1de83d0011f8208cf2fce0dd5f (diff)
Avoid looking up ui.text per highlight range
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/editor.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 21e6cd9b..bbd99795 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -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)
});