perf: avoid eager diff loading and full-file typing work

This commit is contained in:
2026-10-11 15:06:05 +02:00
parent 7b4bc80538
commit 2e05725a38
11 changed files with 1881 additions and 386 deletions
+3 -1
View File
@@ -1551,7 +1551,7 @@ impl Editor {
return;
}
let Some(diff) = &self.diff else { return };
if diff.phase != Phase::View {
if diff.phase != Phase::View || !diff.selected_file_loaded() {
return;
}
let Some(comparison_id) = diff.comparison_id else {
@@ -7436,6 +7436,7 @@ mod tests {
let text = fs::read_to_string(root.join(path)).unwrap();
let lines: Vec<String> = text.lines().map(str::to_owned).collect();
ChangedFile {
loaded: true,
path: PathBuf::from(*path),
old_path: None,
status: FileStatus::Modified,
@@ -7494,6 +7495,7 @@ mod tests {
after: "head".into(),
editable_paths: Default::default(),
files: vec![ChangedFile {
loaded: true,
path: "file.txt".into(),
old_path: None,
status: FileStatus::Modified,