pub fn add_note(prepend: bool) {
    let prompt;

    if prepend {
        prompt = "Add At Start";
    } else {
        prompt = "Add At End";
        p!("Shift+A To Add At Start");
    }

    let note = ask_string(prompt, "", false);
    if note.trim().is_empty() {
        return;
    }
    let new_text;

    if prepend {
        let mut notes = g_get_notes_vec();
        let rest = notes.split_off(1);
        new_text = format!("{}\n{}\n{}", notes[0], note, rest.join("\n"));
        update_file(new_text);
        g_set_last_edit(1);
        goto_first_page();
    } else {
        new_text = format!("{}\n{}", get_notes(false), note);
        update_file(new_text);
        g_set_last_edit(g_get_notes_length());
        goto_last_page();
    }
}
// Provides an input to add a new note
Provides an input to add a new note
Provides an input to add a new note
pub fn add_note(prepend: bool) {
    let prompt;
    if prepend {
        prompt = "Add At Start";
    } else {
        prompt = "Add At End";
        p!("Shift+A To Add At Start");
    }
    let note = ask_string(prompt, "", false);
    if note.trim().is_empty() {
        return;
    }
    let new_text;
    if prepend {
        let mut notes = g_get_notes_vec();
        let rest = notes.split_off(1);
        new_text = format!("{}\n{}\n{}", notes[0], note, rest.join("\n"));
        update_file(new_text);
        g_set_last_edit(1);
        goto_first_page();
    } else {
        new_text = format!("{}\n{}", get_notes(false), note);
        update_file(new_text);
        g_set_last_edit(g_get_notes_length());
        goto_last_page();
    }
}
pub fn add_note ( prepend : bool ) { let prompt ; if prepend { prompt = " " ; } else { prompt = " " ; p ! ( " " ) ; } let note = ask_string ( prompt , " " , false ) ; if note . trim ( ) . is_empty ( ) { return ; } let new_text ; if prepend { let mut notes = g_get_notes_vec ( ) ; let rest = notes . split_off ( 1 ) ; new_text = format ! ( " \n \n " notes [ 0 ] note rest join ( " \n " ) ) ; update_file ( new_text ) ; g_set_last_edit ( 1 ) ; goto_first_page ( ) ; } else { new_text = format ! ( " \n " get_notes ( false ) note ) ; update_file ( new_text ) ; g_set_last_edit ( g_get_notes_length ( ) ) ; goto_last_page ( ) ; } }
Provides an input to add a new note
Provides an input to add a new note
prepend
bool