Missed a couple of places that hard code J for the newline key (#6853)

Signed-off-by: Trae Robrock <trobrock@gmail.com>
This commit is contained in:
Trae Robrock
2026-01-30 18:46:06 -05:00
committed by GitHub
parent 9f586cb161
commit f76a3594dd
2 changed files with 10 additions and 3 deletions
+5 -1
View File
@@ -390,7 +390,11 @@ impl Hinter for GooseCompleter {
fn hint(&self, line: &str, _pos: usize, _ctx: &Context<'_>) -> Option<Self::Hint> {
// Only show hint when line is empty
if line.is_empty() {
Some("Press Enter to send, Ctrl-J for new line".to_string())
let newline_key = super::input::get_newline_key().to_ascii_uppercase();
Some(format!(
"Press Enter to send, Ctrl-{} for new line",
newline_key
))
} else {
None
}
+5 -2
View File
@@ -83,9 +83,12 @@ pub fn get_input(
return Ok(InputResult::Message(message));
}
// Ensure Ctrl-J binding is set for newlines
let newline_key = get_newline_key();
editor.bind_sequence(
rustyline::KeyEvent(rustyline::KeyCode::Char('j'), rustyline::Modifiers::CTRL),
rustyline::KeyEvent(
rustyline::KeyCode::Char(newline_key),
rustyline::Modifiers::CTRL,
),
rustyline::EventHandler::Simple(rustyline::Cmd::Newline),
);