gsh/input/display
The display module is responsible for rendering the REPL prompt and
the user’s current input buffer to the terminal.
It provides real-time syntax highlighting using the contour library,
ensuring that Gleam code is easily readable and beautiful as it is being typed.
Values
pub fn render(prompt: String, buffer: String) -> Nil
Clears the current terminal line and redraws the prompt along with the user’s input.
To prevent syntax highlighting artifacts or crashes while the user is actively typing inside a string literal, this function counts quotation marks. If the quotes are unbalanced (meaning the user is in the middle of typing a string), it temporarily disables the ANSI highlighting until the string is closed.