added reset functionality
This commit is contained in:
@@ -484,6 +484,15 @@ fn handle_key(app: &mut App, code: KeyCode) {
|
||||
KeyCode::Backspace => { search.input.pop(); return; }
|
||||
KeyCode::Enter => {
|
||||
let term = search.input.trim().to_string();
|
||||
// Special command: reset config + exit
|
||||
if term == r"\reset" {
|
||||
if let Some(path) = crate::core::config::config_path() {
|
||||
let _ = std::fs::remove_file(&path);
|
||||
}
|
||||
app.should_exit = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if term.is_empty() {
|
||||
app.search = None;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user