Show More
@@ -358,6 +358,9 b' def create_ipython_shortcuts(shell, for_all_platforms: bool = False):' | |||||
358 | auto_suggest.accept_character |
|
358 | auto_suggest.accept_character | |
359 | ) |
|
359 | ) | |
360 | kb.add("left", filter=has_suggestion & has_focus(DEFAULT_BUFFER))( |
|
360 | 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))( | |||
361 | auto_suggest.accept_and_keep_cursor |
|
364 | auto_suggest.accept_and_keep_cursor | |
362 | ) |
|
365 | ) | |
363 | kb.add("backspace", filter=has_suggestion & has_focus(DEFAULT_BUFFER))( |
|
366 | kb.add("backspace", filter=has_suggestion & has_focus(DEFAULT_BUFFER))( |
@@ -164,8 +164,12 b' def accept_and_keep_cursor(event: KeyPressEvent):' | |||||
164 | if suggestion: |
|
164 | if suggestion: | |
165 | buffer.insert_text(suggestion.text) |
|
165 | buffer.insert_text(suggestion.text) | |
166 | buffer.cursor_position = old_position |
|
166 | buffer.cursor_position = old_position | |
167 | else: |
|
167 | ||
168 | nc.backward_char(event) |
|
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) | |||
169 |
|
173 | |||
170 |
|
174 | |||
171 | def backspace_and_resume_hint(event: KeyPressEvent): |
|
175 | def backspace_and_resume_hint(event: KeyPressEvent): |
General Comments 0
You need to be logged in to leave comments.
Login now