summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-03 03:35:57 +0000
committerBlaž Hrastnik2021-03-03 03:37:30 +0000
commit513effd972ccb537510141c795222ba656f039c5 (patch)
treeff0a089e137854f7d8ee0b97fccd8cfe5e4d4b6b
parent6238be230f65698f499a18c0b696fb06f64021b5 (diff)
ui: unsafe theme_ref is no longer needed.
-rw-r--r--helix-term/src/ui/editor.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index f1860a27..0e9e53f9 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -416,16 +416,10 @@ impl Component for EditorView {
}
fn render(&self, mut area: Rect, surface: &mut Surface, cx: &mut Context) {
- // SAFETY: we cheat around the view_mut() borrow because it doesn't allow us to also borrow
- // theme. Theme is immutable mutating view won't disrupt theme_ref.
- let theme_ref = unsafe { &*(&cx.editor.theme as *const Theme) };
-
for (view, is_focused) in cx.editor.tree.views() {
// TODO: use parent area
- self.render_view(view, view.area, surface, theme_ref, is_focused);
+ self.render_view(view, view.area, surface, &cx.editor.theme, is_focused);
}
-
- // TODO: drop unwrap
}
fn cursor_position(&self, area: Rect, editor: &Editor) -> Option<Position> {