perf: avoid eager diff loading and full-file typing work
This commit is contained in:
+3
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user