pub fn move_lines(n1: usize, n2: usize, dest: usize) {
    let mut left = g_get_notes_vec();
    let mut joined: Vec<String> = vec![];
    let mut moved = left.split_off(n1);
    let mut right = moved.split_off(n2 - n1 + 1);
    let nto = if dest < n1 {
        dest
    } else {
        dest - moved.len() + 1
    };
    joined.append(&mut left);
    joined.append(&mut right);
    joined.splice(nto..nto, moved.iter().cloned());
    update_file(joined.join("\n"));
}
// Moves a range of lines to another index
Moves a range of lines to another index
Moves a range of lines to another index
pub fn move_lines(n1: usize, n2: usize, dest: usize) {
    let mut left = g_get_notes_vec();
    let mut joined: Vec<String> = vec![];
    let mut moved = left.split_off(n1);
    let mut right = moved.split_off(n2 - n1 + 1);
    let nto = if dest < n1 {
        dest
    } else {
        dest - moved.len() + 1
    };
    joined.append(&mut left);
    joined.append(&mut right);
    joined.splice(nto..nto, moved.iter().cloned());
    update_file(joined.join("\n"));
}
pub fn move_lines ( n1 : usize , n2 : usize , dest : usize ) { let mut left = g_get_notes_vec ( ) ; let mut joined : Vec < String > = vec ! [ ] ; let mut moved = left . split_off ( n1 ) ; let mut right = moved . split_off ( n2 - n1 + 1 ) ; let nto = if dest < n1 { dest } else { dest - moved . len ( ) + 1 } ; joined . append ( & mut left ) ; joined . append ( & mut right ) ; joined . splice ( nto .. nto , moved . iter ( ) . cloned ( ) ) ; update_file ( joined . join ( " \n " ) ) ; }
Moves a range of lines to another index
Moves a range of lines to another index
n1
usize
n2
usize
dest
usize