Skip to content

Commit a49c3c9

Browse files
committed
WIP: document some items in theme.rs.
Quite unsure about several of those.
1 parent 02f5ea5 commit a49c3c9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/theme.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,11 @@ impl Theme for ColorfulTheme {
623623
pub(crate) struct TermThemeRenderer<'a> {
624624
term: &'a Term,
625625
theme: &'a dyn Theme,
626+
/// Number of lines of input in the current theme.
626627
height: usize,
628+
/// Height of the current prompt string in the current theme.
627629
prompt_height: usize,
630+
/// TODO what's this?
628631
prompts_reset_height: bool,
629632
}
630633

@@ -839,13 +842,17 @@ impl<'a> TermThemeRenderer<'a> {
839842
})
840843
}
841844

845+
/// Clear the current theme.
846+
///
847+
/// Position the cursor at the beginning of the current line.
842848
pub fn clear(&mut self) -> io::Result<()> {
843849
self.term
844850
.clear_last_lines(self.height + self.prompt_height)?;
845851
self.height = 0;
846852
Ok(())
847853
}
848854

855+
/// Clear the current theme no idea about prompt!
849856
pub fn clear_preserve_prompt(&mut self, size_vec: &[usize]) -> io::Result<()> {
850857
let mut new_height = self.height;
851858
// Check each item size, increment on finding an overflow

0 commit comments

Comments
 (0)