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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user