diff options
Diffstat (limited to 'third_party/rust/termion/src/scroll.rs')
-rw-r--r-- | third_party/rust/termion/src/scroll.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/third_party/rust/termion/src/scroll.rs b/third_party/rust/termion/src/scroll.rs new file mode 100644 index 0000000000..2744507f3c --- /dev/null +++ b/third_party/rust/termion/src/scroll.rs @@ -0,0 +1,23 @@ +//! 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) + } +} |