From afe04c694480d111e98b2416158d2fc6e9a28a96 Mon Sep 17 00:00:00 2001 From: Mike Grunweg Date: Fri, 6 May 2022 10:00:10 +0200 Subject: [PATCH] Tweak comments in TermThemeRenderer::clear(). --- src/theme.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/theme.rs b/src/theme.rs index ae7556f4..b3917902 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -843,12 +843,12 @@ impl<'a> TermThemeRenderer<'a> { /// /// Position the cursor at the beginning of the current line. pub fn clear(&mut self) -> io::Result<()> { - // clear_last_lines only clears the lines preding the current one. + // clear the current line first, so the cursor ends at the beginning of the current line. self.term.clear_line()?; self.term .clear_last_lines(self.height + self.prompt_height)?; - // Technically, self.term now contains self.height + self.prompt_height empty lines after - // the current line. As these are empty, we don't really care, though. + // self.term now contains self.height + self.prompt_height empty lines after + // the current line. That doesn't really matter, as these are empty. self.height = 0; Ok(()) }