Scripts and added :load function

This commit is contained in:
KaraZajac
2026-02-17 22:12:03 -05:00
parent 6dcfb65686
commit 4bc7bd7beb
7 changed files with 558 additions and 1 deletions
+30
View File
@@ -481,6 +481,36 @@ fn run_app<B: ratatui::backend::Backend>(terminal: &mut Terminal<B>, app: &mut A
_ => {}
},
InputMode::LoadFileBrowser => {
const VISIBLE: usize = 16;
match key.code {
KeyCode::Esc => {
app.close_load_browser();
}
KeyCode::Enter => {
let _ = app.load_browser_enter();
}
KeyCode::Up | KeyCode::Char('k') => {
if app.load_browser_selected > 0 {
app.load_browser_selected -= 1;
if app.load_browser_selected < app.load_browser_scroll {
app.load_browser_scroll = app.load_browser_selected;
}
}
}
KeyCode::Down | KeyCode::Char('j') => {
let max = app.load_browser_entries.len().saturating_sub(1);
if app.load_browser_selected < max {
app.load_browser_selected += 1;
if app.load_browser_selected >= app.load_browser_scroll + VISIBLE {
app.load_browser_scroll = app.load_browser_selected - VISIBLE + 1;
}
}
}
_ => {}
}
},
InputMode::License | InputMode::Credits => match key.code {
KeyCode::Esc | KeyCode::Enter => {
app.input_mode = InputMode::Normal;