diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 38 | 
1 files changed, 20 insertions, 18 deletions
| diff --git a/src/main.rs b/src/main.rs index 3b08ad6..fd60bee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,22 +5,9 @@ use rustty::ui::Painter;  use std::time::Duration; -struct Selection<'a> { +struct Point {      x: usize,      y: usize, -    terminal: &'a mut Terminal, -} - -impl<'a> Selection<'a> { -    fn move_selection(&mut self, amount: usize) { -        // Clear old selection cursor -        self.terminal.printline(self.x, self.y, "  "); - -        self.y = self.y + amount; - -        let knockout_cell = Cell::with_style(Color::Byte(0x07), Color::Black, Attr::Default); -        self.terminal.printline_with_cell(0, 2, "->", knockout_cell); -    }  }  fn main() { @@ -29,12 +16,12 @@ fn main() {      let knockout_cell = Cell::with_style(Color::Byte(0x07), Color::Black, Attr::Default); -    let selection = Selection { x: 2, y: 2, terminal: &mut term }; +    let mut selection = Point { x: 0, y: 2 };      loop {          term.printline(0, 0, "Passextract (Press q or Ctrl-C to quit)"); -        term.printline_with_cell(0, 2, "->", knockout_cell); +        term.printline_with_cell(selection.x, selection.y, "->", knockout_cell);          term.printline(5, 2, "test");          let options = vec