fix: route normal-mode cuts through clipboard pipeline
This commit is contained in:
+24
-2
@@ -6992,7 +6992,7 @@ mod system_clipboard {
|
||||
let revision = editor.text_revision();
|
||||
fixture.fail("fail-write", true);
|
||||
for keys in [
|
||||
"yy", "2y3y", "2dd", "cc", "C", "D", "Y", "s", "d2w", "d2b", "c2w", "c2b",
|
||||
"x", "yy", "2y3y", "2dd", "cc", "C", "D", "Y", "s", "d2w", "d2b", "c2w", "c2b",
|
||||
] {
|
||||
type_text(&mut editor, keys);
|
||||
assert_eq!(editor.context().text, "Xone\ntwo\nthree");
|
||||
@@ -7007,6 +7007,29 @@ mod system_clipboard {
|
||||
assert_eq!(editor.context().text, "XXone\ntXwo\nthree");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn normal_x_publishes_graphemes_and_repeat_failure_is_atomic() {
|
||||
let fixture = Fixture::new();
|
||||
let mut editor = fixture.editor();
|
||||
editor
|
||||
.apply(vec![Effect::Replace("e\u{301}👩🚀z".into())])
|
||||
.unwrap();
|
||||
type_text(&mut editor, "x");
|
||||
assert_eq!(editor.context().text, "👩🚀z");
|
||||
assert_eq!(fixture.bytes("state"), "e\u{301}".as_bytes());
|
||||
fixture.fail("fail-write", true);
|
||||
let before = state(&editor);
|
||||
type_text(&mut editor, ".");
|
||||
assert_eq!(state(&editor), before);
|
||||
assert_eq!(fixture.bytes("state"), "e\u{301}".as_bytes());
|
||||
fixture.fail("fail-write", false);
|
||||
type_text(&mut editor, ".");
|
||||
assert_eq!(editor.context().text, "z");
|
||||
assert_eq!(fixture.bytes("state"), "👩🚀".as_bytes());
|
||||
type_text(&mut editor, "uUP");
|
||||
assert_eq!(editor.context().text, "👩🚀z");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn copy_line_publication_failure_keeps_owned_shape_register_and_full_state() {
|
||||
let fixture = Fixture::new();
|
||||
@@ -7707,7 +7730,6 @@ mod system_clipboard {
|
||||
editor.set_clipboard_mode("system").unwrap();
|
||||
editor.apply(vec![Effect::Replace("plain".into())]).unwrap();
|
||||
set_carets(&mut editor, &[(0, 0)], 0);
|
||||
type_text(&mut editor, "x.");
|
||||
type_text(&mut editor, "iX");
|
||||
editor.handle(Input::Backspace);
|
||||
editor.handle(Input::Delete);
|
||||
|
||||
Reference in New Issue
Block a user