Skip to content

Commit f77ba29

Browse files
committed
doc: document four functions in theme.rs.
1 parent f101308 commit f77ba29

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/theme.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,10 +655,14 @@ impl<'a> TermThemeRenderer<'a> {
655655
self.term
656656
}
657657

658+
/// Enlarge the theme by one line: allow displaying one more line of input.
658659
pub fn add_line(&mut self) {
659660
self.height += 1;
660661
}
661662

663+
/// Write a formatted string to this terminal. The string can be span multiple lines.
664+
///
665+
/// `F` is a closure prescribing the text to write into the current instance.
662666
fn write_formatted_str<
663667
F: FnOnce(&mut TermThemeRenderer, &mut dyn fmt::Write) -> fmt::Result,
664668
>(
@@ -671,6 +675,7 @@ impl<'a> TermThemeRenderer<'a> {
671675
self.term.write_str(&buf)
672676
}
673677

678+
/// Like [`write_formatted_string`](#method::write_formatted_string), but add a linebreak afterwards.
674679
fn write_formatted_line<
675680
F: FnOnce(&mut TermThemeRenderer, &mut dyn fmt::Write) -> fmt::Result,
676681
>(
@@ -683,6 +688,9 @@ impl<'a> TermThemeRenderer<'a> {
683688
self.term.write_line(&buf)
684689
}
685690

691+
/// Write a formatted prompt string to this terminal.
692+
///
693+
/// `F` is a closure prescribing the text to write into the current instance.
686694
fn write_formatted_prompt<
687695
F: FnOnce(&mut TermThemeRenderer, &mut dyn fmt::Write) -> fmt::Result,
688696
>(

0 commit comments

Comments
 (0)