mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
fix(tui): restore alt-enter newline alias (#20535)
Fixes https://github.com/openai/codex/issues/20501 ## Summary - add Alt+Enter to the built-in editor newline aliases - update keymap tests that used Alt+Enter as a custom submit binding now that it conflicts with newline - refresh the keymap action-menu snapshot fixture ## Test Plan - `just fmt` - `cargo test -p codex-tui keymap::tests` - `cargo test -p codex-tui bottom_pane::textarea::tests` - `cargo test -p codex-tui keymap_setup::tests` - `cargo test -p codex-tui` - `cargo insta pending-snapshots` - `git diff --check` - `just argument-comment-lint`
This commit is contained in:
committed by
GitHub
Unverified
parent
be71b6fcd1
commit
ff66b3c7eb
@@ -1150,7 +1150,7 @@ mod tests {
|
||||
&TuiKeymap::default(),
|
||||
"composer",
|
||||
"submit",
|
||||
&["ctrl-enter".to_string(), "alt-enter".to_string()],
|
||||
&["ctrl-enter".to_string(), "alt-shift-enter".to_string()],
|
||||
)
|
||||
.expect("multi binding");
|
||||
let multi_runtime = RuntimeKeymap::from_config(&multi_keymap).expect("runtime keymap");
|
||||
@@ -1465,7 +1465,7 @@ mod tests {
|
||||
&TuiKeymap::default(),
|
||||
"composer",
|
||||
"submit",
|
||||
&["ctrl-enter".to_string(), "alt-enter".to_string()],
|
||||
&["ctrl-enter".to_string(), "alt-shift-enter".to_string()],
|
||||
)
|
||||
.expect("multi binding");
|
||||
let runtime = RuntimeKeymap::from_config(&keymap).expect("runtime keymap");
|
||||
@@ -1586,7 +1586,7 @@ mod tests {
|
||||
&TuiKeymap::default(),
|
||||
"composer",
|
||||
"submit",
|
||||
&["ctrl-enter".to_string(), "alt-enter".to_string()],
|
||||
&["ctrl-enter".to_string(), "alt-shift-enter".to_string()],
|
||||
)
|
||||
.expect("multi binding");
|
||||
let runtime = RuntimeKeymap::from_config(&keymap).expect("runtime keymap");
|
||||
@@ -1610,12 +1610,12 @@ mod tests {
|
||||
else {
|
||||
panic!("expected updated keymap");
|
||||
};
|
||||
assert_eq!(bindings, vec!["ctrl-shift-enter", "alt-enter"]);
|
||||
assert_eq!(bindings, vec!["ctrl-shift-enter", "alt-shift-enter"]);
|
||||
assert_eq!(
|
||||
keymap_config.composer.submit,
|
||||
Some(KeybindingsSpec::Many(vec![
|
||||
KeybindingSpec("ctrl-shift-enter".to_string()),
|
||||
KeybindingSpec("alt-enter".to_string())
|
||||
KeybindingSpec("alt-shift-enter".to_string())
|
||||
]))
|
||||
);
|
||||
}
|
||||
@@ -1626,7 +1626,7 @@ mod tests {
|
||||
&TuiKeymap::default(),
|
||||
"composer",
|
||||
"submit",
|
||||
&["ctrl-enter".to_string(), "alt-enter".to_string()],
|
||||
&["ctrl-enter".to_string(), "ctrl-shift-enter".to_string()],
|
||||
)
|
||||
.expect("multi binding");
|
||||
let runtime = RuntimeKeymap::from_config(&keymap).expect("runtime keymap");
|
||||
@@ -1635,7 +1635,7 @@ mod tests {
|
||||
&runtime,
|
||||
"composer",
|
||||
"submit",
|
||||
"alt-enter",
|
||||
"ctrl-shift-enter",
|
||||
&KeymapEditIntent::ReplaceOne {
|
||||
old_key: "ctrl-enter".to_string(),
|
||||
},
|
||||
@@ -1650,11 +1650,11 @@ mod tests {
|
||||
else {
|
||||
panic!("expected updated keymap");
|
||||
};
|
||||
assert_eq!(bindings, vec!["alt-enter"]);
|
||||
assert_eq!(bindings, vec!["ctrl-shift-enter"]);
|
||||
assert_eq!(
|
||||
keymap_config.composer.submit,
|
||||
Some(KeybindingsSpec::One(KeybindingSpec(
|
||||
"alt-enter".to_string()
|
||||
"ctrl-shift-enter".to_string()
|
||||
)))
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user