mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 21:28:48 +00:00
Merge pull request #127 from SoapyDev/fix-search-commands
Fix search commands
This commit is contained in:
commit
2a524191f1
21
src/main.rs
21
src/main.rs
|
@ -142,15 +142,6 @@ fn run<B: Backend>(terminal: &mut Terminal<B>, state: &AppState) -> io::Result<(
|
|||
command_opt = None;
|
||||
}
|
||||
} else {
|
||||
if key.code == KeyCode::Char('q') {
|
||||
return Ok(());
|
||||
}
|
||||
//Activate search mode if the forward slash key gets pressed
|
||||
if key.code == KeyCode::Char('/') {
|
||||
// Enter search mode
|
||||
in_search_mode = true;
|
||||
continue;
|
||||
}
|
||||
//Insert user input into the search bar
|
||||
if in_search_mode {
|
||||
match key.code {
|
||||
|
@ -175,6 +166,18 @@ fn run<B: Backend>(terminal: &mut Terminal<B>, state: &AppState) -> io::Result<(
|
|||
}
|
||||
} else if let Some(cmd) = custom_list.handle_key(key, state) {
|
||||
command_opt = Some(RunningCommand::new(cmd, state));
|
||||
} else {
|
||||
// Handle keys while not in search mode
|
||||
match key.code {
|
||||
// Exit the program
|
||||
KeyCode::Char('q') => return Ok(()),
|
||||
//Activate search mode if the forward slash key gets pressed
|
||||
KeyCode::Char('/') => {
|
||||
in_search_mode = true;
|
||||
continue;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user