mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-22 12:54:59 +00:00
Fix another source of flickering
When you have many keystrokes in the `stdin` (pushing long keys), we are saying to `termion` to print many things. Throttling this.
This commit is contained in:
parent
a36d30594c
commit
10eff07d16
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -141,7 +141,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thumbs"
|
name = "thumbs"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -238,10 +238,12 @@ impl<'a> View<'a> {
|
|||||||
}
|
}
|
||||||
Err(err) => panic!(err),
|
Err(err) => panic!(err),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stdin.keys().for_each(|_| { /* Skip the rest of stdin buffer */ })
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
// Nothing in the buffer. Wait for a bit...
|
// Nothing in the buffer. Wait for a bit...
|
||||||
std::thread::sleep(std::time::Duration::from_millis(100));
|
std::thread::sleep(std::time::Duration::from_millis(50));
|
||||||
continue; // don't render again if nothing new to show
|
continue; // don't render again if nothing new to show
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user