Skip to content

Commit

Permalink
Document the current behaviour of clear_last_lines when called with a…
Browse files Browse the repository at this point in the history
… too large argument.
  • Loading branch information
grunweg committed Apr 30, 2022
1 parent b3ecb7d commit bf33cc9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ impl Term {
/// Clear the last `n` lines before the current line.
///
/// Position the cursor at the beginning of the first line that was cleared.
///
/// **Caution.** When `n` is larger than the number of lines above the
/// current cursor, the top `n` lines are cleared --- including some lines
/// below the cursor.
pub fn clear_last_lines(&self, n: usize) -> io::Result<()> {
self.move_cursor_up(n)?;
for _ in 0..n {
Expand Down

0 comments on commit bf33cc9

Please sign in to comment.