Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add `ViewContext::window_context`

Antonio Scandurrafeaab953a8d7
diff --git a/crates/gpui2/src/window.rs b/crates/gpui2/src/window.rs
index 8f9538001de..2284f3ccc22 100644
--- a/crates/gpui2/src/window.rs
+++ b/crates/gpui2/src/window.rs
@@ -1664,6 +1664,11 @@ impl<'a, V: 'static> ViewContext<'a, V> {
self.view.model.clone()
}
+ /// Access the underlying window context.
+ pub fn window_context(&mut self) -> &mut WindowContext<'a> {
+ &mut self.window_cx
+ }
+
pub fn stack<R>(&mut self, order: u32, f: impl FnOnce(&mut Self) -> R) -> R {
self.window.z_index_stack.push(order);
let result = f(self);