T17 round 2 fixes: merge keeps the newest caret in the lead by where it was given, and a composition cleared to nothing ends

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-09-26 01:16:08 -04:00
1 parent a42f8e44a8
commit 30ffe7a0b2
4 files changed
+46 -21

No files matched your search

+12
View File
@@ -194,6 +194,18 @@ fn a_slow_composition_undoes_in_one_step(cx: &mut TestAppContext) {
});
}
#[gpui::test]
fn a_composition_cleared_to_nothing_ends(cx: &mut TestAppContext) {
let (editor, cx) = editor("", cx);
editor.update_in(cx, |editor, window, cx| {
editor.replace_and_mark_text_in_range(None, "n", None, window, cx);
editor.replace_and_mark_text_in_range(None, "", None, window, cx);
editor.type_text("x", cx);
editor.undo(cx);
assert_eq!(editor.text(), "", "typing after the cleared mark undoes");
});
}
impl CodeEditor {
/// Whether line `line` has a row now.
fn frame_shows(&self, line: usize) -> bool {