diff --git a/crates/gpui3/src/gpui3.rs b/crates/gpui3/src/gpui3.rs index cdefb94edd1bd4386792013741e9d85a8f03a36a..1af9a1cc222386f812fbf1e9c6d535bfafc968e8 100644 --- a/crates/gpui3/src/gpui3.rs +++ b/crates/gpui3/src/gpui3.rs @@ -11,7 +11,7 @@ mod geometry; mod hover; mod image_cache; mod interactive; -mod keymap_matcher; +mod keymap; mod platform; mod scene; mod style; @@ -39,7 +39,7 @@ pub use gpui3_macros::*; pub use hover::*; pub use image_cache::*; pub use interactive::*; -pub use keymap_matcher::*; +pub use keymap::*; pub use platform::*; pub use refineable::*; pub use scene::*; diff --git a/crates/gpui3/src/keymap_matcher/binding.rs b/crates/gpui3/src/keymap/binding.rs similarity index 100% rename from crates/gpui3/src/keymap_matcher/binding.rs rename to crates/gpui3/src/keymap/binding.rs diff --git a/crates/gpui3/src/keymap_matcher/keymap.rs b/crates/gpui3/src/keymap/keymap.rs similarity index 100% rename from crates/gpui3/src/keymap_matcher/keymap.rs rename to crates/gpui3/src/keymap/keymap.rs diff --git a/crates/gpui3/src/keymap_matcher/keymap_context.rs b/crates/gpui3/src/keymap/keymap_context.rs similarity index 100% rename from crates/gpui3/src/keymap_matcher/keymap_context.rs rename to crates/gpui3/src/keymap/keymap_context.rs diff --git a/crates/gpui3/src/keymap_matcher.rs b/crates/gpui3/src/keymap/matcher.rs similarity index 98% rename from crates/gpui3/src/keymap_matcher.rs rename to crates/gpui3/src/keymap/matcher.rs index 955b1890936a1ce74f5c054fd4d481cbddd1524b..38c8cc42f0cc46e40d25dfb32a2f12b1cc57d3a0 100644 --- a/crates/gpui3/src/keymap_matcher.rs +++ b/crates/gpui3/src/keymap/matcher.rs @@ -1,12 +1,4 @@ -mod binding; -mod keymap; -mod keymap_context; - -pub use binding::*; -pub use keymap::*; -pub use keymap_context::*; - -use crate::Keystroke; +use crate::{Binding, Keymap, KeymapContext, KeymapVersion, Keystroke}; use smallvec::SmallVec; use std::any::{Any, TypeId}; @@ -16,13 +8,13 @@ pub trait Action: Any + Send + Sync { fn as_any(&self) -> &dyn Any; } -pub struct KeymapMatcher { +pub struct KeyMatcher { pending_keystrokes: Vec, keymap: Keymap, keymap_version: KeymapVersion, } -impl KeymapMatcher { +impl KeyMatcher { pub fn new(keymap: Keymap) -> Self { Self { pending_keystrokes: Vec::new(), @@ -106,7 +98,7 @@ impl KeymapMatcher { } } -impl Default for KeymapMatcher { +impl Default for KeyMatcher { fn default() -> Self { Self::new(Keymap::default()) } diff --git a/crates/gpui3/src/keymap/mod.rs b/crates/gpui3/src/keymap/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..26fcfac477fb73a70f6151ea4c9d2ea155d88d95 --- /dev/null +++ b/crates/gpui3/src/keymap/mod.rs @@ -0,0 +1,9 @@ +mod binding; +mod keymap; +mod keymap_context; +mod matcher; + +pub use binding::*; +pub use keymap::*; +pub use keymap_context::*; +pub use matcher::*; diff --git a/crates/gpui3/src/window.rs b/crates/gpui3/src/window.rs index 5ab1902bbfc8cd4ea83e89d0067a46bade3c2779..02160d68329e8687cd9fadb447f906e20e1e81b5 100644 --- a/crates/gpui3/src/window.rs +++ b/crates/gpui3/src/window.rs @@ -2,7 +2,7 @@ use crate::{ px, size, Action, AnyBox, AnyView, AppContext, AsyncWindowContext, AvailableSpace, BorrowAppContext, Bounds, BoxShadow, Context, Corners, DevicePixels, DisplayId, Edges, Effect, Element, EntityId, EventEmitter, FocusEvent, FontId, GlobalElementId, GlyphId, Handle, Hsla, - ImageData, InputEvent, IsZero, KeyListener, KeyMatch, KeymapMatcher, Keystroke, LayoutId, + ImageData, InputEvent, IsZero, KeyListener, KeyMatch, KeyMatcher, Keystroke, LayoutId, MainThread, MainThreadOnly, MonochromeSprite, MouseMoveEvent, Path, Pixels, Platform, PlatformAtlas, PlatformWindow, Point, PolychromeSprite, Quad, Reference, RenderGlyphParams, RenderImageParams, RenderSvgParams, ScaledPixels, SceneBuilder, Shadow, SharedString, Size, @@ -150,8 +150,8 @@ pub struct Window { pub(crate) element_id_stack: GlobalElementId, prev_frame_element_states: HashMap, element_states: HashMap, - prev_frame_key_matchers: HashMap, - key_matchers: HashMap, + prev_frame_key_matchers: HashMap, + key_matchers: HashMap, z_index_stack: StackingOrder, content_mask_stack: Vec>, mouse_listeners: HashMap>,