MatchEditor(3I)
β¨ MatchEditor(3I) β¨
okay bestie so this is a page from the InterViews Reference Manual, section 3I, and the whole vibe is: string editor but it finishes your sentences for you π (yes, the page is called MatchEditor, but the star of the show is lowkey named CompletionEditor β we don't make the rules, we just report them fr fr).
πΈ NAME πΈ
MatchEditor β a StringEditor with string completion β¨
π SYNOPSIS π
#include <InterViews/compeditor.h>
π¦ DESCRIPTION π¦
CompletionEditor is a StringEditor subclass, and her whole main character thing is that she can complete whatever's currently chillin' in the edit buffer, matched against a list of strings you give her. She's literally made for the situation where the user has to pick one thing out of a huge pile of well-known strings β instead of typing the whole thing out like a peasant, they type the first few characters, then hit the completion character, and she fills in the rest. slay π
so here's the lore, no cap: when the user types the completion character, CompletionEditor checks the current string against the list of possible completions. π§
- if the current string is a prefix of one or more completion strings, characters get appended so the edit string holds the longest common prefix π
- if the current string doesn't match any completion string, trailing characters get removed until the string matches at least one completion βοΈ
- and in any case, if there's more than one possible completion of a string, CompletionEditor rings the workstation bell π (yes she's dramatic, we love that for her)
π PUBLIC OPERATIONS π
π CompletionEditor(ButtonState*, const char* sample, const char* done)
spin up a brand new CompletionEditor object β¨ The ButtonState, the sample string, and the done termination string all get passed straight along to the StringEditor constructor. passing the aux cord, basically π§
π void Completions(const char* completions[], int count, char complete)
tell her the list of completion strings and the completion character π« Heads up though:
- the initial completion list is empty π
- the completion character defaults to a space β£
- and ngl, CompletionEditor does not copy the strings in the list β she just points at them, so keep them alive, bestie π
π₯ SEE ALSO π₯
StringEditor(3I) β her origin story π
and that's the whole page, periodt π«Ά This gem dropped as part of InterViews, dated 13 Dec 1989 β vintage but make it iconic πβ¨
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms