aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-11 15:36:46 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-11 15:49:00 -0500
commit30c8ad23f51a8bdc067e3a76da7004ba5be8682f (patch)
treef4c9d8da7468b53df99079b9ee14ea06943d7f2c /src/term.rs
parent6203def48a689e30677a63b03d755aa0740e6e18 (diff)
downloadvt100-rust-30c8ad23f51a8bdc067e3a76da7004ba5be8682f.tar.gz
vt100-rust-30c8ad23f51a8bdc067e3a76da7004ba5be8682f.zip
optimize erases a bit more
Diffstat (limited to 'src/term.rs')
-rw-r--r--src/term.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/term.rs b/src/term.rs
index 170e2ca..cb5488a 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -14,6 +14,15 @@ impl BufWrite for ClearScreen {
}
#[derive(Default, Debug)]
+pub struct ClearRowForward;
+
+impl BufWrite for ClearRowForward {
+ fn write_buf(&self, buf: &mut Vec<u8>) {
+ buf.extend_from_slice(b"\x1b[K");
+ }
+}
+
+#[derive(Default, Debug)]
pub struct CRLF;
impl BufWrite for CRLF {
@@ -253,6 +262,12 @@ pub struct EraseChar {
count: u16,
}
+impl EraseChar {
+ pub fn new(count: u16) -> Self {
+ Self { count }
+ }
+}
+
impl Default for EraseChar {
fn default() -> Self {
Self { count: 1 }