17 lines
594 B
Rust
17 lines
594 B
Rust
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");
|
|
}
|