Skip to content

Commit 2ab6622

Browse files
committed
doc: Improve doc comments for the clear_* functions.
The comment for clear_to_end_of_screen was simply wrong.
1 parent c75de7e commit 2ab6622

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/term.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,15 @@ impl Term {
428428

429429
/// Clear the current line.
430430
///
431-
/// This positions the cursor at the beginning of the current line.
431+
/// Position the cursor at the beginning of the current line.
432432
#[inline]
433433
pub fn clear_line(&self) -> io::Result<()> {
434434
clear_line(self)
435435
}
436436

437437
/// Clear the last `n` lines before the current line.
438438
///
439-
/// This positions the cursor at the beginning of the first line
440-
/// that was cleared.
439+
/// Position the cursor at the beginning of the first line that was cleared.
441440
pub fn clear_last_lines(&self, n: usize) -> io::Result<()> {
442441
self.move_cursor_up(n)?;
443442
for _ in 0..n {
@@ -449,18 +448,21 @@ impl Term {
449448
}
450449

451450
/// Clear the entire screen.
451+
///
452+
/// Move the cursor to the upper left corner of the screen.
452453
#[inline]
453454
pub fn clear_screen(&self) -> io::Result<()> {
454455
clear_screen(self)
455456
}
456457

457-
/// Clear the entire screen.
458+
/// Clear everything from the current cursor position to the end of the screen.
459+
/// The cursor stays in its position.
458460
#[inline]
459461
pub fn clear_to_end_of_screen(&self) -> io::Result<()> {
460462
clear_to_end_of_screen(self)
461463
}
462464

463-
/// Clear the last `n` chars of the current line.
465+
/// Clear the last `n` characters of the current line.
464466
#[inline]
465467
pub fn clear_chars(&self, n: usize) -> io::Result<()> {
466468
clear_chars(self, n)

0 commit comments

Comments
 (0)