mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-11-08 09:09:17 +01:00
Remove the modifier filter in the list mode
This commit is contained in:
parent
9b0eeb815a
commit
279ebdc153
12
src/list.rs
12
src/list.rs
@ -1,6 +1,6 @@
|
||||
use anyhow::Result;
|
||||
use crossterm::{
|
||||
event::{self, Event, KeyCode, KeyEventKind, KeyModifiers},
|
||||
event::{self, Event, KeyCode, KeyEventKind},
|
||||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
|
||||
ExecutableCommand,
|
||||
};
|
||||
@ -28,16 +28,10 @@ pub fn list(app_state: &mut AppState) -> Result<()> {
|
||||
|
||||
let key = loop {
|
||||
match event::read()? {
|
||||
Event::Key(key) => {
|
||||
if key.modifiers != KeyModifiers::NONE {
|
||||
continue;
|
||||
}
|
||||
|
||||
match key.kind {
|
||||
Event::Key(key) => match key.kind {
|
||||
KeyEventKind::Press | KeyEventKind::Repeat => break key,
|
||||
KeyEventKind::Release => (),
|
||||
}
|
||||
}
|
||||
},
|
||||
// Redraw
|
||||
Event::Resize(_, _) => continue 'outer,
|
||||
// Ignore
|
||||
|
Loading…
Reference in New Issue
Block a user