Skip to content

Commit bf33cc9

Browse files
committed
Document the current behaviour of clear_last_lines when called with a too large argument.
1 parent b3ecb7d commit bf33cc9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/term.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,10 @@ impl Term {
449449
/// Clear the last `n` lines before the current line.
450450
///
451451
/// Position the cursor at the beginning of the first line that was cleared.
452+
///
453+
/// **Caution.** When `n` is larger than the number of lines above the
454+
/// current cursor, the top `n` lines are cleared --- including some lines
455+
/// below the cursor.
452456
pub fn clear_last_lines(&self, n: usize) -> io::Result<()> {
453457
self.move_cursor_up(n)?;
454458
for _ in 0..n {

0 commit comments

Comments
 (0)