From de1db6fb8c283d8654e018a3de425e1da255ace7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 4 Nov 2026 21:39:49 +0000 Subject: [PATCH] Parameters: reach the end of a long expression the same way on every OS in its test (#12104) a_long_expression_opens_wide_while_edited_and_enter_applies_it moved the cursor to the end of the wrapped field with Ctrl+End. The control channel's cmd flag also sets ctrl, and on macOS egui treats Ctrl with End as an unhandled Emacs-style chord, so the cursor stayed where the click put it. The typed " * 2" did not land at the end, the parameter kept its old expression, and the test failed on macOS while it passed on Linux. The test now uses Command+Down with ctrl off, which egui maps to the end of the text on every platform. What the test checks is unchanged. Co-authored-by: Claude Opus 5.5 --- crates/ui-egui/src/params_dialog.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/params_dialog.rs b/crates/ui-egui/src/params_dialog.rs index bfe4bc43f..c99efc04a 100644 --- a/crates/ui-egui/src/params_dialog.rs +++ b/crates/ui-egui/src/params_dialog.rs @@ -1828,8 +1828,9 @@ mod tests { assert!(wide.width() > cell.width() * 1.5, "the edited formula opens wide: {wide:?} vs {cell:?}"); assert!((wide.left() - cell.left()).abs() < 1.0, "it opens from its own cell: {wide:?} vs {cell:?}"); - // The open field wraps, so the end of the text is Ctrl+End. - h.run(&json!([{"key":"End","cmd":true}, {"text":" * 2"}, {"key":"Enter"}])).unwrap(); + // The open field wraps, so the end of the text is Command+Down. Not Ctrl+End: + // egui ignores that on macOS, and the typed tail would land where the click put the cursor. + h.run(&json!([{"key":"ArrowDown","cmd":true,"ctrl":false}, {"text":" * 2"}, {"key":"Enter"}])).unwrap(); h.frames(2); assert_eq!(h.app.session.doc.param("length").unwrap().expr, format!("{long} * 2")); let after = crate::scenario::rect_of("param:length").unwrap();