load changed files src when selected
[?]
Apr 22, 2025, 6:25 PM
NRCUG4R2NIM2ANIETSUZ7WZDXFOOCMJ73ROP5MDYJA4RUT4PYA4QCDependencies
- [2]
WT3GA27Padd cursor with selection - [3]
EC3TVL4Xadd untracked files - [4]
KT5UYXGKfix selection after adding file, add changed file diffs - [5]
YBJRDOTCmake all repo actions async - [6]
D7A7MSIHallow to defer or abandon record, add buttons - [7]
4WO3ZJM2show untracked files' contents - [8]
W4LFX7IHgroup diffs by file name - [9]
PTFDJ567add untracked files encoding - [10]
AMPZ2BXKshow changed files diffs (only Edit atm) - [11]
V55EAIWQadd src file LRU cache - [12]
ELG3UDT6allow to rm added files - [13]
W7IUT3ZVstart recording impl - [14]
UCBNZULEmake changed files paths optional (no path for root) - [15]
6YZAVBWUInitial commit - [16]
BJXUYQ2Yshow untracked file contents in read-only text editor - [17]
NOB64XMRfmt and clippy
Change contents
- edit in crates/flowers_ui/src/main.rs at line 161[11.1790]→[7.2460:2567](∅→∅),[6.78]→[7.2460:2567](∅→∅),[7.2567]→[9.179:215](∅→∅),[9.215]→[7.2696:2705](∅→∅),[7.2696]→[7.2696:2705](∅→∅),[7.2705]→[9.216:217](∅→∅),[7.2706]→[7.2706:2723](∅→∅)
enum UntrackedFileContents {Loading {path: String,},Loaded {path: String,content: FileEditorContent,},}#[derive(Debug)] - edit in crates/flowers_ui/src/main.rs at line 171
/// The order of the vec matches `repo::ChangedFile`type ChangedFileContents = Vec<Option<FileEditorContent>>; - replacement in crates/flowers_ui/src/main.rs at line 192
pub enum ChangedFileDiffWithoutContents {enum ChangedFileDiffWithoutContents { - edit in crates/flowers_ui/src/main.rs at line 204[10.1689]→[9.507:508](∅→∅),[11.2380]→[9.507:508](∅→∅),[9.507]→[9.507:508](∅→∅),[9.508]→[10.1690:1802](∅→∅)
/// The order of the vec matches `repo::ChangedFile`type ChangedFileContents = Vec<Option<FileEditorContent>>; - edit in crates/flowers_ui/src/main.rs at line 258
// Load the file - replacement in crates/flowers_ui/src/main.rs at line 263[5.6557]→[4.4765:4798](∅→∅),[3.2511]→[4.4765:4798](∅→∅),[4.4798]→[5.6558:6621](∅→∅),[5.6621]→[8.3205:3399](∅→∅),[8.3399]→[4.5061:5128](∅→∅),[5.6701]→[4.5061:5128](∅→∅),[4.5061]→[4.5061:5128](∅→∅)
let changed_file_selection =|repo: &repo::State, ix: usize| -> cursor::Selection {let path = repo.changed_files.iter().nth(ix).map(|(k, _v)| k).unwrap().clone();cursor::Selection::ChangedFile { ix, path }};let changed_file_selection = |repo: &repo::State,ix: usize,src_files_cache: &mut SrcFilesCache,src_file_load_tx: &watch::Sender<String>|-> cursor::Selection {let path = repo.changed_files.iter().nth(ix).map(|(k, _v)| k).unwrap().clone();load_src_file_if_not_cached(src_files_cache, src_file_load_tx, &path); - edit in crates/flowers_ui/src/main.rs at line 278
cursor::Selection::ChangedFile { ix, path }}; - replacement in crates/flowers_ui/src/main.rs at line 317
changed_file_selection(repo, ix)changed_file_selection(repo,ix,&mut state.src_files_cache,&state.src_file_load_tx,) - replacement in crates/flowers_ui/src/main.rs at line 344
changed_file_selection(repo, ix)changed_file_selection(repo,ix,&mut state.src_files_cache,&state.src_file_load_tx,) - replacement in crates/flowers_ui/src/main.rs at line 361
changed_file_selection(repo, ix)changed_file_selection(repo,ix,&mut state.src_files_cache,&state.src_file_load_tx,) - replacement in crates/flowers_ui/src/main.rs at line 376
Some(changed_file_selection(repo, ix))Some(changed_file_selection(repo,ix,&mut state.src_files_cache,&state.src_file_load_tx,)) - replacement in crates/flowers_ui/src/main.rs at line 412
changed_file_selection(repo, ix)changed_file_selection(repo,ix,&mut state.src_files_cache,&state.src_file_load_tx,) - replacement in crates/flowers_ui/src/main.rs at line 434
changed_file_selection(repo, ix)changed_file_selection(repo,ix,&mut state.src_files_cache,&state.src_file_load_tx,) - replacement in crates/flowers_ui/src/main.rs at line 451
changed_file_selection(repo, ix)changed_file_selection(repo,ix,&mut state.src_files_cache,&state.src_file_load_tx,) - replacement in crates/flowers_ui/src/main.rs at line 475
Some(changed_file_selection(repo, ix))Some(changed_file_selection(repo,ix,&mut state.src_files_cache,&state.src_file_load_tx,)) - replacement in crates/flowers_ui/src/main.rs at line 490
// Load the fileload_src_file_if_not_cached(&mut state.src_files_cache,&state.src_file_load_tx,path,);}cursor::Selection::ChangedFile { path, .. } => { - edit in crates/flowers_ui/src/main.rs at line 503
cursor::Selection::ChangedFile { .. } => {} - replacement in crates/flowers_ui/src/main.rs at line 583
Some(changed_file_selection(repo, ix))Some(changed_file_selection(repo,ix,&mut state.src_files_cache,&state.src_file_load_tx,)) - replacement in crates/flowers_ui/src/main.rs at line 827[7.8142]→[5.15972:16155](∅→∅),[5.15972]→[5.15972:16155](∅→∅),[5.16155]→[8.4198:4520](∅→∅),[8.4520]→[5.16379:16407](∅→∅),[5.16379]→[5.16379:16407](∅→∅)
cursor::Selection::ChangedFile { ix: _, path } => repo.changed_files.iter().enumerate().find(|(_ix, (file_path, _diffs))| file_path == &path).map(|(ix, (file_path, _diffs))| {cursor::Selection::ChangedFile {ix,path: file_path.clone(),}}),cursor::Selection::ChangedFile { ix: _, path } => {load_src_file_if_not_cached(&mut state.src_files_cache,&state.src_file_load_tx,&path,);repo.changed_files.iter().enumerate().find(|(_ix, (file_path, _diffs))| {file_path == &path}).map(|(ix, (file_path, _diffs))| {cursor::Selection::ChangedFile {ix,path: file_path.clone(),}})}