pub fn swap_notes() {
    let ans = ask_string("Swap (n1 n2)", "", true);
    if ans.is_empty() {
        return;
    }
    let mut split = ans.split_whitespace().map(|s| s.trim());
    let n1 = parse_note_ans(split.next().unwrap_or("0"));
    let n2 = parse_note_ans(split.next().unwrap_or("0"));
    if !check_line_exists(n1) || !check_line_exists(n2) {
        return;
    }

    // If one of the two items is the last edited note
    // Swap it so it points to the correct one
    let last_edit = g_get_last_edit();
    if last_edit == n1 {
        g_set_last_edit(n2)
    } else if last_edit == n2 {
        g_set_last_edit(n1)
    }

    swap_lines(n1, n2);
}
// Swaps 2 notes specified by 2 numbers separated by whitespace (1 10)
Swaps 2 notes specified by 2 numbers separated by whitespace (1 10)
Swaps 2 notes specified by 2 numbers separated by whitespace ( 1 10 )
pub fn swap_notes() {
    let ans = ask_string("Swap (n1 n2)", "", true);
    if ans.is_empty() {
        return;
    }
    let mut split = ans.split_whitespace().map(|s| s.trim());
    let n1 = parse_note_ans(split.next().unwrap_or("0"));
    let n2 = parse_note_ans(split.next().unwrap_or("0"));
    if !check_line_exists(n1) || !check_line_exists(n2) {
        return;
    }
    // If one of the two items is the last edited note
    // Swap it so it points to the correct one
    let last_edit = g_get_last_edit();
    if last_edit == n1 {
        g_set_last_edit(n2)
    } else if last_edit == n2 {
        g_set_last_edit(n1)
    }
    swap_lines(n1, n2);
}
pub fn swap_notes ( ) { let ans = ask_string ( " " , " " , true ) ; if ans . is_empty ( ) { return ; } let mut split = ans . split_whitespace ( ) . map ( | s | s . trim ( ) ) ; let n1 = parse_note_ans ( split . next ( ) . unwrap_or ( " " ) ) ; let n2 = parse_note_ans ( split . next ( ) . unwrap_or ( " " ) ) ; if ! check_line_exists ( n1 ) || ! check_line_exists ( n2 ) { return ; } // If one of the two items is the last edited note // Swap it so it points to the correct one let last_edit = g_get_last_edit ( ) ; if last_edit == n1 { g_set_last_edit ( n2 ) } else if last_edit == n2 { g_set_last_edit ( n1 ) } swap_lines ( n1 , n2 ) ; }
Swaps 2 notes specified by 2 numbers separated by whitespace (1 10)
Swaps 2 notes specified by 2 numbers separated by whitespace ( 1 10 )