mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-27 00:00:03 +03: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 anyhow::Result;
|
||||||
use crossterm::{
|
use crossterm::{
|
||||||
event::{self, Event, KeyCode, KeyEventKind, KeyModifiers},
|
event::{self, Event, KeyCode, KeyEventKind},
|
||||||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
|
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
|
||||||
ExecutableCommand,
|
ExecutableCommand,
|
||||||
};
|
};
|
||||||
|
@ -28,16 +28,10 @@ pub fn list(app_state: &mut AppState) -> Result<()> {
|
||||||
|
|
||||||
let key = loop {
|
let key = loop {
|
||||||
match event::read()? {
|
match event::read()? {
|
||||||
Event::Key(key) => {
|
Event::Key(key) => match key.kind {
|
||||||
if key.modifiers != KeyModifiers::NONE {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
match key.kind {
|
|
||||||
KeyEventKind::Press | KeyEventKind::Repeat => break key,
|
KeyEventKind::Press | KeyEventKind::Repeat => break key,
|
||||||
KeyEventKind::Release => (),
|
KeyEventKind::Release => (),
|
||||||
}
|
},
|
||||||
}
|
|
||||||
// Redraw
|
// Redraw
|
||||||
Event::Resize(_, _) => continue 'outer,
|
Event::Resize(_, _) => continue 'outer,
|
||||||
// Ignore
|
// Ignore
|
||||||
|
|
Loading…
Reference in a new issue