Skip to main content

Crate rmut_front

Crate rmut_front 

Source
Expand description

What every rmut front end needs and no toolkit provides: the key vocabulary, the keymap over rmut_session::Function, and (as the rounds move it here) the layout and formatting that turn a session into rows of text. Nothing in here draws.

Re-exports§

pub use key::KeyCode;
pub use key::KeyEvent;
pub use key::KeyModifiers;
pub use keymap::KeyPattern;
pub use keymap::Keymap;
pub use keymap::PagerAction;
pub use keymap::parse_key;
pub use keymap::parse_sequence;
pub use keymap::resolve_function;

Modules§

editor
The line prompt’s editing, history and completion: what happens to the text when a key arrives, with no opinion about what the text is for. A front end owns a LineEdit per open prompt and a History for the session; the prompt’s meaning stays with it.
index
One index row: the $index_format text and the style its marks and the [[color_index]] rules give it. Both front ends draw the mailbox from here; only the selection marking is their own.
key
Keys as a front end reports them, with no toolkit’s type in the signature. Shaped like crossterm’s so the terminal front end maps one to the other at its read site and nothing else notices.
keymap
Default keybindings plus config remaps ([keys.index] / [keys.pager], action = "key"). Key syntax: a single character, or ctrl+x / alt+x, or a name: enter, esc, space, tab, backspace, up, down, left, right, pgup, pgdn, home, end.
pager
The pager’s rows and the index’s scroll math: what a message looks like as lines of text at a width, and where the cursor lands. No toolkit; both front ends draw from this.
status
The status bar and the terminal title: mutt’s $status_format, $ts_status_format and $pager_format, expanded from the session. Both front ends show the same line.
style
How text is colored, said without a toolkit: the sixteen named colors a muttrc can name, and a style that is a color pair plus the three attributes mutt’s color lines carry. Each front end maps this onto its own kind of style.
theme
mutt’s look, from the config: the slot colors, the quote palette, the status bar. In front-end terms; each front end maps them onto its own styles.