From 348760556aded99003930b03da362e69b9f76347 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 13 Nov 2023 18:33:08 +0100 Subject: [PATCH] :lipstick: --- crates/gpui2/src/key_dispatch.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/gpui2/src/key_dispatch.rs b/crates/gpui2/src/key_dispatch.rs index bc8e1f8f85b128c8178ba1ea234929c7cf1265bc..e517b8d34b51eda4473923e09ab8d1e4f0af56a1 100644 --- a/crates/gpui2/src/key_dispatch.rs +++ b/crates/gpui2/src/key_dispatch.rs @@ -175,19 +175,6 @@ impl DispatchTree { } } - pub fn node(&self, node_id: DispatchNodeId) -> &DispatchNode { - &self.nodes[node_id.0] - } - - fn active_node(&mut self) -> &mut DispatchNode { - let active_node_id = self.active_node_id(); - &mut self.nodes[active_node_id.0] - } - - fn active_node_id(&self) -> DispatchNodeId { - *self.node_stack.last().unwrap() - } - pub fn dispatch_path(&self, target: DispatchNodeId) -> SmallVec<[DispatchNodeId; 32]> { let mut dispatch_path: SmallVec<[DispatchNodeId; 32]> = SmallVec::new(); let mut current_node_id = Some(target); @@ -199,9 +186,22 @@ impl DispatchTree { dispatch_path } + pub fn node(&self, node_id: DispatchNodeId) -> &DispatchNode { + &self.nodes[node_id.0] + } + + fn active_node(&mut self) -> &mut DispatchNode { + let active_node_id = self.active_node_id(); + &mut self.nodes[active_node_id.0] + } + pub fn focusable_node_id(&self, target: FocusId) -> Option { self.focusable_node_ids.get(&target).copied() } + + fn active_node_id(&self) -> DispatchNodeId { + *self.node_stack.last().unwrap() + } } pub trait KeyDispatch: 'static {