Skip to content

Commit 7035699

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

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
@@ -626,8 +626,11 @@ impl Theme for ColorfulTheme {
626626
pub(crate) struct TermThemeRenderer<'a> {
627627
term: &'a Term,
628628
theme: &'a dyn Theme,
629+
/// Number of lines of input in the current theme.
629630
height: usize,
631+
/// Height of the current prompt string in the current theme.
630632
prompt_height: usize,
633+
/// TODO what's this?
631634
prompts_reset_height: bool,
632635
}
633636

@@ -850,13 +853,17 @@ impl<'a> TermThemeRenderer<'a> {
850853
})
851854
}
852855

856+
/// Clear the current theme.
857+
///
858+
/// Position the cursor at the beginning of the current line.
853859
pub fn clear(&mut self) -> io::Result<()> {
854860
self.term
855861
.clear_last_lines(self.height + self.prompt_height)?;
856862
self.height = 0;
857863
Ok(())
858864
}
859865

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

0 commit comments

Comments
 (0)