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
+6 -3
View File
@@ -115,7 +115,7 @@ fn typed_diff_edits_unsaved_working_after_and_preserves_undo_on_explicit_close()
session
.editor()
.diff()
.is_some_and(|diff| diff.phase == Phase::View)
.is_some_and(|diff| diff.phase == Phase::View && diff.selected_file_loaded())
});
let comparison = session
.editor()
@@ -222,7 +222,7 @@ fn editable_diff_navigation_skips_omitted_lines_without_expanding_excerpts() {
session
.editor()
.diff()
.is_some_and(|diff| diff.phase == Phase::View)
.is_some_and(|diff| diff.phase == Phase::View && diff.selected_file_loaded())
});
session.handle(Input::BackTab);
let shown = |session: &EditorSession| {
@@ -350,7 +350,7 @@ fn readonly_jump_history_restores_the_comparison_file_and_source_cursor() {
session.handle(input);
}
wait_until(&mut session, |session| {
session.editor().diff().unwrap().phase == Phase::View
session.editor().diff().unwrap().selected_file_loaded()
});
session.handle(Input::Char('\t'));
let first_origin = session.editor().cursor();
@@ -365,6 +365,9 @@ fn readonly_jump_history_restores_the_comparison_file_and_source_cursor() {
] {
session.handle(input);
}
wait_until(&mut session, |session| {
session.editor().diff().unwrap().selected_file_loaded()
});
let second_origin = session.editor().cursor();
type_query(&mut session, "/second_before");
session.handle(Input::Enter);