vim: Respect count for paragraphs (#33489)

Closes #32462 

Release Notes:

- vim: Paragraph objects now support counts (`d2ap`, `v2ap`, etc.)

---------

Co-authored-by: Rift <no@e.mail>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Rift 2025-06-28 00:05:47 -04:00 committed by GitHub
parent ba4fc1bcfc
commit 97c5c5a6e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 182 additions and 54 deletions

View file

@ -2031,3 +2031,43 @@ async fn test_delete_unmatched_brace(cx: &mut gpui::TestAppContext) {
.await
.assert_eq(" oth(wow)\n oth(wow)\n");
}
#[gpui::test]
async fn test_paragraph_multi_delete(cx: &mut gpui::TestAppContext) {
let mut cx = NeovimBackedTestContext::new(cx).await;
cx.set_shared_state(indoc! {
"
Emacs is
ˇa great
operating system
all it lacks
is a
decent text editor
"
})
.await;
cx.simulate_shared_keystrokes("2 d a p").await;
cx.shared_state().await.assert_eq(indoc! {
"
ˇall it lacks
is a
decent text editor
"
});
cx.simulate_shared_keystrokes("d a p").await;
cx.shared_clipboard()
.await
.assert_eq("all it lacks\nis a\n\n");
//reset to initial state
cx.simulate_shared_keystrokes("2 u").await;
cx.simulate_shared_keystrokes("4 d a p").await;
cx.shared_state().await.assert_eq(indoc! {"ˇ"});
}