pub fn menu_action(ans: (MenuAnswer, usize)) {
    match ans.0 {
        MenuAnswer::AddNote => add_note(false),
        MenuAnswer::AddNoteStart => add_note(true),
        MenuAnswer::EditNote => edit_note(0),
        MenuAnswer::FindNotes => find_notes(false),
        MenuAnswer::FindNotesSuggest => find_notes(true),
        MenuAnswer::SwapNotes => swap_notes(),
        MenuAnswer::DeleteNotes => delete_notes(),
        MenuAnswer::ResetFile => reset_file(),
        MenuAnswer::ChangeSecurity => change_security(),
        MenuAnswer::CycleLeft => cycle_left(),
        MenuAnswer::CycleRight => cycle_right(),
        MenuAnswer::FirstPage => goto_first_page(),
        MenuAnswer::LastPage => goto_last_page(),
        MenuAnswer::RefreshPage => refresh_page(),
        MenuAnswer::EditLastNote => edit_last_note(),
        MenuAnswer::PageNumber => show_page(max(1, ans.1)),
        MenuAnswer::ChangeMenu => cycle_menu(),
        MenuAnswer::ShowAllNotes => show_all_notes(),
        MenuAnswer::ShowAbout => show_about(),
        MenuAnswer::GotoPage => goto_page(),
        MenuAnswer::IncreasePageSize => change_page_size(true),
        MenuAnswer::DecreasePageSize => change_page_size(false),
        MenuAnswer::ShowStats => show_stats(),
        MenuAnswer::ScreenSaver => show_screensaver(),
        MenuAnswer::OpenFromPath => open_from_path(),
        MenuAnswer::FetchSource => fetch_source(),
        MenuAnswer::Destroy => destroy(),
        MenuAnswer::ChangeRowSpace => change_row_space(),
        MenuAnswer::ChangeColors => change_colors(),
        MenuAnswer::MoveNotes => move_notes(),
        MenuAnswer::ModeAction => mode_action(),
        MenuAnswer::Undo => undo_last_edit(),
        MenuAnswer::Exit => ask_exit(),
        MenuAnswer::Nothing => {}
    }
}
// Reacts to the live keyboard input from the main menu
Reacts to the live keyboard input from the main menu
Reacts to the live keyboard input from the main menu
pub fn menu_action(ans: (MenuAnswer, usize)) {
    match ans.0 {
        MenuAnswer::AddNote => add_note(false),
        MenuAnswer::AddNoteStart => add_note(true),
        MenuAnswer::EditNote => edit_note(0),
        MenuAnswer::FindNotes => find_notes(false),
        MenuAnswer::FindNotesSuggest => find_notes(true),
        MenuAnswer::SwapNotes => swap_notes(),
        MenuAnswer::DeleteNotes => delete_notes(),
        MenuAnswer::ResetFile => reset_file(),
        MenuAnswer::ChangeSecurity => change_security(),
        MenuAnswer::CycleLeft => cycle_left(),
        MenuAnswer::CycleRight => cycle_right(),
        MenuAnswer::FirstPage => goto_first_page(),
        MenuAnswer::LastPage => goto_last_page(),
        MenuAnswer::RefreshPage => refresh_page(),
        MenuAnswer::EditLastNote => edit_last_note(),
        MenuAnswer::PageNumber => show_page(max(1, ans.1)),
        MenuAnswer::ChangeMenu => cycle_menu(),
        MenuAnswer::ShowAllNotes => show_all_notes(),
        MenuAnswer::ShowAbout => show_about(),
        MenuAnswer::GotoPage => goto_page(),
        MenuAnswer::IncreasePageSize => change_page_size(true),
        MenuAnswer::DecreasePageSize => change_page_size(false),
        MenuAnswer::ShowStats => show_stats(),
        MenuAnswer::ScreenSaver => show_screensaver(),
        MenuAnswer::OpenFromPath => open_from_path(),
        MenuAnswer::FetchSource => fetch_source(),
        MenuAnswer::Destroy => destroy(),
        MenuAnswer::ChangeRowSpace => change_row_space(),
        MenuAnswer::ChangeColors => change_colors(),
        MenuAnswer::MoveNotes => move_notes(),
        MenuAnswer::ModeAction => mode_action(),
        MenuAnswer::Undo => undo_last_edit(),
        MenuAnswer::Exit => ask_exit(),
        MenuAnswer::Nothing => {}
    }
}
pub fn menu_action ( ans : ( MenuAnswer , usize ) ) { match ans . 0 { MenuAnswer :: AddNote => add_note ( false ) , MenuAnswer :: AddNoteStart => add_note ( true ) , MenuAnswer :: EditNote => edit_note ( 0 ) , MenuAnswer :: FindNotes => find_notes ( false ) , MenuAnswer :: FindNotesSuggest => find_notes ( true ) , MenuAnswer :: SwapNotes => swap_notes ( ) , MenuAnswer :: DeleteNotes => delete_notes ( ) , MenuAnswer :: ResetFile => reset_file ( ) , MenuAnswer :: ChangeSecurity => change_security ( ) , MenuAnswer :: CycleLeft => cycle_left ( ) , MenuAnswer :: CycleRight => cycle_right ( ) , MenuAnswer :: FirstPage => goto_first_page ( ) , MenuAnswer :: LastPage => goto_last_page ( ) , MenuAnswer :: RefreshPage => refresh_page ( ) , MenuAnswer :: EditLastNote => edit_last_note ( ) , MenuAnswer :: PageNumber => show_page ( max ( 1 , ans . 1 ) ) , MenuAnswer :: ChangeMenu => cycle_menu ( ) , MenuAnswer :: ShowAllNotes => show_all_notes ( ) , MenuAnswer :: ShowAbout => show_about ( ) , MenuAnswer :: GotoPage => goto_page ( ) , MenuAnswer :: IncreasePageSize => change_page_size ( true ) , MenuAnswer :: DecreasePageSize => change_page_size ( false ) , MenuAnswer :: ShowStats => show_stats ( ) , MenuAnswer :: ScreenSaver => show_screensaver ( ) , MenuAnswer :: OpenFromPath => open_from_path ( ) , MenuAnswer :: FetchSource => fetch_source ( ) , MenuAnswer :: Destroy => destroy ( ) , MenuAnswer :: ChangeRowSpace => change_row_space ( ) , MenuAnswer :: ChangeColors => change_colors ( ) , MenuAnswer :: MoveNotes => move_notes ( ) , MenuAnswer :: ModeAction => mode_action ( ) , MenuAnswer :: Undo => undo_last_edit ( ) , MenuAnswer :: Exit => ask_exit ( ) , MenuAnswer :: Nothing => { } } }
Reacts to the live keyboard input from the main menu
Reacts to the live keyboard input from the main menu
ans
(MenuAnswer, usize)
ans
(MenuAnswer, usize)