Skip to main content

Crate hjkl_form

Crate hjkl_form 

Source
Expand description

§hjkl-form

Vim-modal forms for hjkl-based apps.

Each text field hosts its own hjkl_engine::Editor, so users get the full vim grammar inside form inputs. The form itself runs a small FSM over Form-Normal / Form-Insert modes for focus navigation and validation, delegating keystrokes to the focused field’s editor when in insert mode.

Renderers live in adapter crates: hjkl-editor-tui::form::draw_form ships the ratatui flavor.

Re-exports§

pub use field::CheckboxField;
pub use field::Field;
pub use field::FieldMeta;
pub use field::SelectField;
pub use field::SubmitField;
pub use field::TextFieldEditor;
pub use form::Form;
pub use form::FormEvent;
pub use form::FormMode;
pub use host::FormFieldHost;
pub use submit::SubmitFn;
pub use submit::SubmitOutcome;
pub use validate::Validator;
pub use validate::validate_field;

Modules§

field
Field types — the building blocks of a Form.
form
Form — the top-level container.
fsm
Form-level FSM. Routes keys between focus navigation, field delegation, and submit firing.
host
Minimal Host impl for per-field editors.
submit
Submit handler types.
validate
Field validators.

Structs§

Input
A key press with modifier flags. The vim engine reads modifiers directly off this struct (e.g. input.ctrl && input.key == Key::Char('d')).

Enums§

CoarseMode
Discipline-agnostic coarse mode for app chrome (status badge, cursor shape). Unlike VimMode — which names vim-specific states — CoarseMode is a minimal projection: “are we inserting text, selecting, or idle?”
Key
A key code, mirroring the subset of [crossterm::event::KeyCode] the vim engine actually consumes. Null is the conventional sentinel for “no input” (matching the previous tui_textarea::Key shape) so call sites can early-return on unsupported keys.