24 lines
460 B
Rust
24 lines
460 B
Rust
//! Scrolling.
|
|
|
|
use std::fmt;
|
|
|
|
/// Scroll up.
|
|
#[derive(Copy, Clone, PartialEq, Eq)]
|
|
pub struct Up(pub u16);
|
|
|
|
impl fmt::Display for Up {
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
write!(f, csi!("{}S"), self.0)
|
|
}
|
|
}
|
|
|
|
/// Scroll down.
|
|
#[derive(Copy, Clone, PartialEq, Eq)]
|
|
pub struct Down(pub u16);
|
|
|
|
impl fmt::Display for Down {
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
write!(f, csi!("{}T"), self.0)
|
|
}
|
|
}
|