fix: yank whole lines with yy and preserve paste shape
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
use vamp::editor::{Editor, Effect, Input};
|
||||
#[test]
|
||||
fn yy_copies_current_whole_line_for_paste_below_it() {
|
||||
let mut editor = Editor::open(None, vec![]).unwrap();
|
||||
editor.set_clipboard_mode("separate").unwrap();
|
||||
editor
|
||||
.apply(vec![Effect::Replace("first\nsecond\n".into())])
|
||||
.unwrap();
|
||||
for key in "llyy".chars() {
|
||||
editor.handle(Input::Char(key));
|
||||
}
|
||||
assert_eq!(editor.cursor().column, 2);
|
||||
assert_eq!(editor.context().text, "first\nsecond\n");
|
||||
editor.handle(Input::Char('p'));
|
||||
assert_eq!(editor.context().text, "first\nfirst\nsecond\n");
|
||||
}
|
||||
Reference in New Issue
Block a user