aboutsummaryrefslogtreecommitdiff
path: root/src/term.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/term.rs')
-rw-r--r--src/term.rs24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/term.rs b/src/term.rs
index 9d92e282..4c5e1424 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -1,8 +1,7 @@
/// Exports the `Term` type which is a high-level API for the Grid
-use std::sync::Arc;
use std::ops::Range;
-use ansi::{self, Attr, DebugHandler};
+use ansi::{self, Attr};
use grid::{self, Grid, CellFlags};
use tty;
use ::Rgb;
@@ -70,10 +69,6 @@ impl Cursor {
}
}
-struct Mover<'a> {
- cursor: &'a mut Cursor,
-}
-
pub struct Term {
/// The grid
grid: Grid,
@@ -85,7 +80,7 @@ pub struct Term {
alt: bool,
/// Reference to the underlying tty
- tty: tty::Tty,
+ _tty: tty::Tty,
/// The cursor
cursor: Cursor,
@@ -130,7 +125,7 @@ impl Term {
alt_cursor: Cursor::default(),
fg: DEFAULT_FG,
bg: DEFAULT_BG,
- tty: tty,
+ _tty: tty,
tabs: tabs,
attr: CellFlags::empty(),
mode: TermMode::empty(),
@@ -157,10 +152,6 @@ impl Term {
}
}
- pub fn resize(&mut self) {
- unimplemented!();
- }
-
#[inline]
pub fn cursor_x(&self) -> u16 {
self.cursor.x
@@ -195,13 +186,6 @@ impl Term {
cell.flags = self.attr;
}
- /// Advance to next line
- fn newline_c(&mut self, count: u16) {
- // TODO handle scroll
- self.cursor.x = 0;
- self.cursor.y += 1;
- }
-
/// Convenience function for scrolling
fn scroll(&mut self, count: isize) {
println!("[TERM] scrolling {} lines", count);
@@ -299,6 +283,7 @@ impl ansi::Handler for Term {
#[inline]
fn backspace(&mut self, count: i64) {
println!("backspace");
+ // TODO this is incorrect; count unused
self.cursor.x -= 1;
self.set_char(' ');
}
@@ -357,7 +342,6 @@ impl ansi::Handler for Term {
println!("clear_line: {:?}", mode);
match mode {
ansi::LineClearMode::Right => {
- let cols = self.grid.num_cols();
let row = &mut self.grid[self.cursor.y as usize];
let start = self.cursor.x as usize;
for cell in row[start..].iter_mut() {