pub fn history_add(id: u8, str: &str)Expand description
Add str to the history channel identified by id.
Call this after the user confirms an input line (typically in the owning
dialog’s close handler) so subsequent pops of the history viewer offer the
entry. Each history-capable input line should use a unique, stable id
(typically a small application-defined constant) so channels don’t share
entries.
Operation order:
- Ignore empty strings.
- Remove any existing duplicate for this
(id, str)pair. - Evict globally-oldest entries until the new entry fits within the budget.
- Append the new entry (newest position).
§Turbo Vision heritage
Ports historyAdd (histlist.cpp); the raw block pointer + byte-offset
encoding becomes a thread_local! Vec<HistRec>.