mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-21 21:42:23 -05:00
Remove the modifier filter in the list mode
This commit is contained in:
parent
9b0eeb815a
commit
279ebdc153
1 changed files with 5 additions and 11 deletions
16
src/list.rs
16
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 {
|
KeyEventKind::Press | KeyEventKind::Repeat => break key,
|
||||||
continue;
|
KeyEventKind::Release => (),
|
||||||
}
|
},
|
||||||
|
|
||||||
match key.kind {
|
|
||||||
KeyEventKind::Press | KeyEventKind::Repeat => break key,
|
|
||||||
KeyEventKind::Release => (),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Redraw
|
// Redraw
|
||||||
Event::Resize(_, _) => continue 'outer,
|
Event::Resize(_, _) => continue 'outer,
|
||||||
// Ignore
|
// Ignore
|
||||||
|
|
Loading…
Reference in a new issue