File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
crates/chat-cli/src/cli/chat Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -220,9 +220,9 @@ const ROTATING_TIPS: [&str; 12] = [
220220
221221const GREETING_BREAK_POINT : usize = 80 ;
222222
223- const POPULAR_SHORTCUTS : & str = color_print:: cstr! { "<black!><green!>/help</green!> all commands <em>•</em> <green!>ctrl + j</green!> new lines <em>•</em> <green!>ctrl + s</green!> fuzzy search</black!>" } ;
223+ const POPULAR_SHORTCUTS : & str = color_print:: cstr! { "<black!><green!>/help</green!> all commands <em>•</em> <green!>ctrl + j</green!> or <green!>shift + enter</green!> new lines <em>•</em> <green!>ctrl + s</green!> fuzzy search</black!>" } ;
224224const SMALL_SCREEN_POPULAR_SHORTCUTS : & str = color_print:: cstr! { "<black!><green!>/help</green!> all commands
225- <green!>ctrl + j</green!> new lines
225+ <green!>ctrl + j</green!> or <green!>shift + enter</green!> new lines
226226<green!>ctrl + s</green!> fuzzy search
227227</black!>" } ;
228228
@@ -272,7 +272,7 @@ const HELP_TEXT: &str = color_print::cstr! {"
272272
273273<cyan,em>Tips:</cyan,em>
274274<em>!{command}</em> <black!>Quickly execute a command in your current session</black!>
275- <em>Ctrl(^) + j</em> <black!>Insert new-line to provide multi-line prompt. Alternatively, [Alt(⌥) + Enter(⏎)]</black!>
275+ <em>Ctrl(^) + j</em> <black!>Insert new-line to provide multi-line prompt. Alternatively, [Alt(⌥) + Enter(⏎) or Shift + Enter(⏎) ]</black!>
276276<em>Ctrl(^) + s</em> <black!>Fuzzy search commands and context files. Use Tab to select multiple items.</black!>
277277 <black!>Change the keybind to ctrl+x with: q settings chat.skimCommandKey x (where x is any key)</black!>
278278
Original file line number Diff line number Diff line change @@ -294,6 +294,12 @@ pub fn rl(
294294 EventHandler :: Simple ( Cmd :: Insert ( 1 , "\n " . to_string ( ) ) ) ,
295295 ) ;
296296
297+ // Add custom keybinding for Shift+Enter to insert a newline
298+ rl. bind_sequence (
299+ KeyEvent ( KeyCode :: Enter , Modifiers :: SHIFT ) ,
300+ EventHandler :: Simple ( Cmd :: Insert ( 1 , "\n " . to_string ( ) ) ) ,
301+ ) ;
302+
297303 // Add custom keybinding for Ctrl+J to insert a newline
298304 rl. bind_sequence (
299305 KeyEvent ( KeyCode :: Char ( 'j' ) , Modifiers :: CTRL ) ,
You can’t perform that action at this time.
0 commit comments