mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-26 11:23:31 +04:00
ui: unsafe theme_ref is no longer needed.
This commit is contained in:
parent
6238be230f
commit
513effd972
@ -416,16 +416,10 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn render(&self, mut area: Rect, surface: &mut Surface, cx: &mut Context) {
|
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() {
|
for (view, is_focused) in cx.editor.tree.views() {
|
||||||
// TODO: use parent area
|
// 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> {
|
fn cursor_position(&self, area: Rect, editor: &Editor) -> Option<Position> {
|
||||||
|
Loading…
Reference in New Issue
Block a user