TEI5NQ3SCTU6JQIPU62B2AUXWRFSEU6DZYJG5T526G666VV5XXPAC WT3GA27PQ2AOAIGK65O3Q4DMX4AZDVNULBLRL6GF4QW6QCASUEAAC W7IUT3ZVMFH77IGKLAL7WX7IVVTGTY3FKEJ3WHMP3KI37B6NENLQC YBJRDOTCX3ZRDB5EVXJBR55FX3CADCSIGMYWNYVC2PD5W3GXR3DQC D7A7MSIHJS3IAOLEPK52M4CZLDPLO7JB3Y62XACT2AM6UUCPQ6BAC 4WO3ZJM2RNYZCBPS7FGYAEBELYD57OSS7LEUYCWGZBCAY272SNQQC FDDPOH5RRFK323PLIFJM2K2NWTSE2LW525YMHWJA6KIFPY2QVQNQC NRCUG4R2NIM2ANIETSUZ7WZDXFOOCMJ73ROP5MDYJA4RUT4PYA4QC Y5ATDI2HRWTTYJAVUR7SVWQVB4ZKKDZF3UVE4JJQFZ7RX7H7VPJQC ZVI4AWERNOTDJ3765HJXRBZT57XPNKVONQ6TGOGNPOL2VN42KMJQC QMAUTRB6R5R7ABWT2JIDEA7LMILZOS3PGPZIF3YUFKRVLW6HGKTQC OQ6HSAWHIRTAIIWMDGCTIOK47JDY7QVVAHLRDA2R5TTJKNSBFCWQC AHWWRC73FXLSUDAJBU5UU76MZETHD3DSGJ7OLZPFEHXBDJ733QNAC UJPRF6DASB6TLFQSUZETOMCUVXIE5TXMCKWXMZR5SNE3IYCX4PMQC 6YZAVBWU6E5FYOI5JGEIPXGZLIKAW6LS2AOFIQWEE5DMOPPCD5PQC let log_file_selection = |log_entry: &repo::LogEntry,file_ix: usize,log_ix: usize,hash: pijul::Hash|-> cursor::Selection {let path = log_entry.file_paths.iter().nth(file_ix).unwrap().clone();cursor::Selection::LogChange {ix: log_ix,hash,file: Some(cursor::LogChangeFileSelection { ix: file_ix, path }),}};
Some(_) => todo!(),
Some(cursor::LogChangeFileSelection {ix: file_ix,path: _,}) => {let log_entry =repo.log.iter().nth(*log_ix).unwrap();let file_ix = if log_entry.file_paths.len().saturating_sub(1)== *file_ix{0} else {file_ix + 1};log_file_selection(log_entry, file_ix, *log_ix, *hash,)}
Some(_) => todo!(),
Some(cursor::LogChangeFileSelection {ix: file_ix,path: _,}) => {let log_entry =repo.log.iter().nth(*log_ix).unwrap();let file_ix = if 0 == *file_ix {log_entry.file_paths.len() - 1} else {file_ix - 1};log_file_selection(log_entry, file_ix, *log_ix, *hash,)}
}Task::none()}Message::CursorLeft | Message::CursorRight => {if let Some(repo) = state.repo.as_ref() {// The outter `Option` is for whether the selection should change, the inner is what it should change to if solet new_selection: Option<Option<cursor::Selection>> =match state.cursor.selection.as_ref() {Some(cursor::Selection::LogChange {ix,hash,file,}) => Some(Some(if file.is_none() {let log_entry = repo.log.iter().nth(*ix).unwrap();let file = if let Some(path) =log_entry.file_paths.first(){Some(cursor::LogChangeFileSelection {ix: 0,path: path.clone(),})} else {None};cursor::Selection::LogChange {ix: *ix,hash: *hash,file,}} else {cursor::Selection::LogChange {ix: *ix,hash: *hash,file: None,}})),Some(cursor::Selection::UntrackedFile { .. })| Some(cursor::Selection::ChangedFile { .. })| None => None,};if let Some(selection) = new_selection {state.cursor.selection = selection;}