Skip to main content

Module editor

Module editor 

Source
Expand description

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.

Structs§

Complete
Tab-completion state: candidates for the token at start, tail the text after the cursor that the completion leaves alone, and expect the whole line after the last insertion (an edit in between restarts the match).
History
Prompt history per bucket, newest first.
LineEdit
The text of a line prompt and the cursor in it, as a char index.

Enums§

Edit
What a key did to the line, or what it asks the front end for.

Constants§

KNOWN_BUCKETS
The history buckets, mutt-style: one shared list per input class, named so a persisted file maps back onto them.

Functions§

byte_at
Byte offset of the cursor-th char (the length when past the end).
prompt_line
A line prompt as it fits width columns: the label, then the text with the cursor marker (a low bar) in it. When that is wider than the line, the start is cut away behind a < so the cursor stays in view, with a few columns of what follows it.