aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/editor.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-11-19 06:41:03 +0000
committerBlaž Hrastnik2022-11-19 06:41:03 +0000
commita640ab6b1f8aa3d968712acdd085feb48d81feb7 (patch)
treea96efccfef67d24cedd6e19b12fb50710a340e28 /helix-term/src/ui/editor.rs
parent8be2d1dcbfeff88f47b8bfb9685f2ab45a72efb5 (diff)
Avoid repeatedly loading config
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r--helix-term/src/ui/editor.rs17
1 files changed, 5 insertions, 12 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index f2a588e3..1989e0f8 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -82,6 +82,7 @@ impl EditorView {
let inner = view.inner_area(doc);
let area = view.area;
let theme = &editor.theme;
+ let config = editor.config();
// DAP: Highlight current stack frame position
let stack_frame = editor.debugger.as_ref().and_then(|debugger| {
@@ -117,10 +118,10 @@ impl EditorView {
}
}
- if is_focused && editor.config().cursorline {
+ if is_focused && config.cursorline {
Self::highlight_cursorline(doc, view, surface, theme);
}
- if is_focused && editor.config().cursorcolumn {
+ if is_focused && config.cursorcolumn {
Self::highlight_cursorcolumn(doc, view, surface, theme);
}
@@ -141,22 +142,14 @@ impl EditorView {
doc,
view,
theme,
- &editor.config().cursor_shape,
+ &config.cursor_shape,
),
))
} else {
Box::new(highlights)
};
- Self::render_text_highlights(
- doc,
- view.offset,
- inner,
- surface,
- theme,
- highlights,
- &editor.config(),
- );
+ Self::render_text_highlights(doc, view.offset, inner, surface, theme, highlights, &config);
Self::render_gutter(editor, doc, view, view.area, surface, theme, is_focused);
Self::render_rulers(editor, doc, view, inner, surface, theme);