mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-23 13:45:12 +02:00
other: clean up some fixmes (#1171)
This commit is contained in:
parent
69318465ae
commit
6b9663a2c2
@ -338,7 +338,8 @@ pub fn parse_query(
|
|||||||
let mut condition: Option<QueryComparison> = None;
|
let mut condition: Option<QueryComparison> = None;
|
||||||
let mut value: Option<f64> = None;
|
let mut value: Option<f64> = None;
|
||||||
|
|
||||||
// TODO: Jeez, what the heck did I write here... add some tests and clean this up, please.
|
// TODO: Jeez, what the heck did I write here... add some tests and clean this up in the
|
||||||
|
// future.
|
||||||
if content == "=" {
|
if content == "=" {
|
||||||
condition = Some(QueryComparison::Equal);
|
condition = Some(QueryComparison::Equal);
|
||||||
if let Some(queue_next) = query.pop_front() {
|
if let Some(queue_next) = query.pop_front() {
|
||||||
|
@ -175,7 +175,6 @@ fn main() -> Result<()> {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
BottomEvent::Resize => {
|
BottomEvent::Resize => {
|
||||||
// FIXME: This is bugged with frozen?
|
|
||||||
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
||||||
}
|
}
|
||||||
BottomEvent::KeyInput(event) => {
|
BottomEvent::KeyInput(event) => {
|
||||||
|
15
src/lib.rs
15
src/lib.rs
@ -433,12 +433,12 @@ pub fn create_input_thread(
|
|||||||
if let Ok(poll) = poll(Duration::from_millis(20)) {
|
if let Ok(poll) = poll(Duration::from_millis(20)) {
|
||||||
if poll {
|
if poll {
|
||||||
if let Ok(event) = read() {
|
if let Ok(event) = read() {
|
||||||
// FIXME: Handle all other event cases.
|
|
||||||
match event {
|
match event {
|
||||||
// TODO: Might want to debounce this in the future, or take into account the actual resize
|
|
||||||
// values. Maybe we want to keep the current implementation in case the resize event might
|
|
||||||
// not fire... not sure.
|
|
||||||
Event::Resize(_, _) => {
|
Event::Resize(_, _) => {
|
||||||
|
// TODO: Might want to debounce this in the future, or take into account the actual resize
|
||||||
|
// values. Maybe we want to keep the current implementation in case the resize event might
|
||||||
|
// not fire... not sure.
|
||||||
|
|
||||||
if sender.send(BottomEvent::Resize).is_err() {
|
if sender.send(BottomEvent::Resize).is_err() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -449,8 +449,7 @@ pub fn create_input_thread(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Event::Key(key) if key.kind == KeyEventKind::Press => {
|
Event::Key(key) if key.kind == KeyEventKind::Press => {
|
||||||
// For now, we only care about keydown events. This may change in the future.
|
// For now, we only care about key down events. This may change in the future.
|
||||||
|
|
||||||
if sender.send(BottomEvent::KeyInput(key)).is_err() {
|
if sender.send(BottomEvent::KeyInput(key)).is_err() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -472,7 +471,9 @@ pub fn create_input_thread(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => (),
|
Event::Key(_) => {}
|
||||||
|
Event::FocusGained => {}
|
||||||
|
Event::FocusLost => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user