File tree Expand file tree Collapse file tree
IPython/terminal/shortcuts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -358,6 +358,9 @@ def not_inside_unclosed_string():
358358 auto_suggest .accept_character
359359 )
360360 kb .add ("left" , filter = has_suggestion & has_focus (DEFAULT_BUFFER ))(
361+ auto_suggest .accept_and_move_cursor_left
362+ )
363+ kb .add ("c-down" , filter = has_suggestion & has_focus (DEFAULT_BUFFER ))(
361364 auto_suggest .accept_and_keep_cursor
362365 )
363366 kb .add ("backspace" , filter = has_suggestion & has_focus (DEFAULT_BUFFER ))(
Original file line number Diff line number Diff line change @@ -164,8 +164,12 @@ def accept_and_keep_cursor(event: KeyPressEvent):
164164 if suggestion :
165165 buffer .insert_text (suggestion .text )
166166 buffer .cursor_position = old_position
167- else :
168- nc .backward_char (event )
167+
168+
169+ def accept_and_move_cursor_left (event : KeyPressEvent ):
170+ """Accept autosuggestion and move cursor left"""
171+ accept_and_keep_cursor (event )
172+ nc .backward_char (event )
169173
170174
171175def backspace_and_resume_hint (event : KeyPressEvent ):
You can’t perform that action at this time.
0 commit comments