From e83ebd1fabdff0315e10f85109f8ae24b9f068e5 Mon Sep 17 00:00:00 2001 From: 0x2CA <2478557459@qq.com> Date: Thu, 27 Feb 2025 03:38:50 +0800 Subject: [PATCH] vim: Add more tests for replace with register (#25316) Closes #ISSUE Add more tests Release Notes: - N/A --- crates/vim/src/normal/paste.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/vim/src/normal/paste.rs b/crates/vim/src/normal/paste.rs index 8b6e94c630..a3fc7a960e 100644 --- a/crates/vim/src/normal/paste.rs +++ b/crates/vim/src/normal/paste.rs @@ -943,6 +943,22 @@ mod test { "}, Mode::Normal, ); + cx.simulate_keystrokes("g r r"); + cx.assert_state( + indoc! {" + fisˇh + two three + "}, + Mode::Normal, + ); + cx.simulate_keystrokes("j w g r $"); + cx.assert_state( + indoc! {" + fish + two fisˇh + "}, + Mode::Normal, + ); let clipboard: Register = cx.read_from_clipboard().unwrap().into(); assert_eq!(clipboard.text, "fish"); }