lattice_host/keymap.rs
1//! Re-export shim for the static keymap catalog + `keymap_entry!` macro.
2//!
3//! K.2.4.A.0.1 (2026-06-02) relocated the canonical definitions of
4//! `KeymapEntry` / `default_keymap` / `lookup` / `entries` and the
5//! `keymap_entry!` macro into `lattice-mode::keymap_entry`, so mode
6//! crates contributing keymaps via `Mode::keymap()` can declare
7//! bindings without depending on `lattice-host`. The matcher engine
8//! (`KeymapTrie` / `KeymapLayer` / `BoundCommand`) still lives in
9//! host; only the static catalog + entry-row metadata moved.
10//!
11//! This shim preserves every `lattice_host::keymap::{...}` import
12//! path used by:
13//!
14//! - `dispatch.rs` — `:describe-key` static-catalog hits via
15//! `crate::keymap::lookup(chord)`; `:keymap` listing via
16//! `crate::keymap::{BindingMode, entries}`.
17//! - `lattice-ui-tui::keymap` — re-export chain feeding the TUI
18//! drift-test catalog walker in `input.rs` and the app-glue
19//! reference in `app.rs`.
20//! - The various `lattice-host::keymap_normal` / `keymap_visual` /
21//! `keymap_insert` / `keymap_replace` modules that import
22//! `BindingMode` via `crate::keymap::BindingMode`.
23//!
24//! Plan to retire the shim once downstream imports flip to
25//! `lattice_mode::{KeymapEntry, keymap_entry, ...}` directly.
26
27// `BindingMode` already moved to `lattice-mode` in K.2.2; the
28// re-export at this path has lived here since.
29pub use lattice_mode::BindingMode;
30
31// K.2.4.A.0.1: static catalog + entry-row metadata.
32pub use lattice_mode::keymap_entry::{
33 __builtin_source, KeymapEntry, default_keymap, entries, lookup,
34};
35
36// `#[macro_export]`'d macros land at the defining crate's root. The
37// host had `pub use lattice_host::keymap_entry;` consumers (notably
38// `lattice-ui-tui::lib.rs:51`); re-export through the host's root so
39// those paths still resolve. The re-export lives at the lib root
40// (see `lattice-host/src/lib.rs`), not here, since macros can't be
41// re-exported from a non-root module.