From f4b7600f28e5d056569424aaa83e05127e1a0816 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 6 Aug 2016 04:49:10 -0400 Subject: Remove `set_cursor` calls Don't move the cursor when the selection is changed. It was flickering, which looked rather distracting. Removing the cursor makes the interface look more fluid and snappy. --- src/main.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index ce0f4fe..f0cb840 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,8 +58,6 @@ fn main() { term.printline(5, i + 3, s) } - term.set_cursor(selection.x + 2, selection.y).unwrap(); - let evt = term.get_event(Duration::from_millis(100)).unwrap(); if let Some(Event::Key(ch)) = evt { match ch { @@ -73,7 +71,6 @@ fn main() { selection.y = selection.y + 1; term.printline_with_cell(selection.x, selection.y, "->", knockout_cell); - term.set_cursor(selection.x + 2, selection.y).unwrap(); } } 'k' => { @@ -83,7 +80,6 @@ fn main() { selection.y = selection.y - 1; term.printline_with_cell(selection.x, selection.y, "->", knockout_cell); - term.set_cursor(selection.x + 2, selection.y).unwrap(); } } '\x0D' => { -- cgit v1.2.3