repline: change error formatting

This commit is contained in:
2025-02-20 22:05:43 -06:00
parent 088cd4d1e4
commit eebabf02fb
3 changed files with 21 additions and 1 deletions

View File

@@ -112,6 +112,17 @@ impl<'a> Editor<'a> {
Ok(())
}
pub fn print_err<W: Write>(&self, w: &mut W, err: impl Display) -> ReplResult<()> {
queue!(
w,
SavePosition,
Clear(ClearType::UntilNewLine),
Print(err),
RestorePosition
)?;
Ok(())
}
/// Prints the characters after the cursor on the current line.
pub fn print_tail<W: Write>(&self, w: &mut W) -> ReplResult<()> {
let Self { tail, .. } = self;