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 <noreply@anthropic.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user