Re-understand that the line just below git deletion is "inside" hunk

Fixes "go to previous hunk" getting stuck on a deletion, never going
further up
This commit is contained in:
Julia
2023-10-24 11:17:42 +02:00
parent 67e590202a
commit 48cdefe6cf
3 changed files with 46 additions and 6 deletions
+40
View File
@@ -6800,6 +6800,46 @@ async fn go_to_hunk(deterministic: Arc<Deterministic>, cx: &mut gpui::TestAppCon
.unindent(),
);
cx.update_editor(|editor, cx| {
editor.go_to_prev_hunk(&GoToPrevHunk, cx);
});
cx.assert_editor_state(
&r#"
use some::modified;
ˇ
fn main() {
println!("hello there");
println!("around the");
println!("world");
}
"#
.unindent(),
);
cx.update_editor(|editor, cx| {
for _ in 0..3 {
editor.go_to_prev_hunk(&GoToPrevHunk, cx);
}
});
cx.assert_editor_state(
&r#"
use some::modified;
fn main() {
ˇ println!("hello there");
println!("around the");
println!("world");
}
"#
.unindent(),
);
cx.update_editor(|editor, cx| {
editor.fold(&Fold, cx);