Skip to content

Commit

Permalink
Tweak comments in TermThemeRenderer::clear().
Browse files Browse the repository at this point in the history
  • Loading branch information
grunweg committed May 6, 2022
1 parent 0e04cb9 commit afe04c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/theme.rs
Expand Up @@ -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(())
}
Expand Down

0 comments on commit afe04c6

Please sign in to comment.