##// END OF EJS Templates
Add missing line_below/line_above conditions
krassowski -
Show More
@@ -52,12 +52,14 b' def has_focus(value: FocusableElement):'
52 52 return Condition(tester)
53 53
54 54
55 @undoc
55 56 @Condition
56 57 def has_line_below() -> bool:
57 58 document = get_app().current_buffer.document
58 59 return document.cursor_position_row < len(document.lines) - 1
59 60
60 61
62 @undoc
61 63 @Condition
62 64 def has_line_above() -> bool:
63 65 document = get_app().current_buffer.document
@@ -378,12 +380,13 b' def create_ipython_shortcuts(shell, for_all_platforms: bool = False) -> KeyBindi'
378 380 & has_suggestion
379 381 & has_focus(DEFAULT_BUFFER),
380 382 )(auto_suggest.swap_autosuggestion_down(shell.auto_suggest))
381 kb.add("up", filter=navigable_suggestions & has_focus(DEFAULT_BUFFER))(
382 auto_suggest.up_and_update_hint
383 )
384 kb.add("down", filter=navigable_suggestions & has_focus(DEFAULT_BUFFER))(
385 auto_suggest.down_and_update_hint
386 )
383 kb.add(
384 "up", filter=has_line_above & navigable_suggestions & has_focus(DEFAULT_BUFFER)
385 )(auto_suggest.up_and_update_hint)
386 kb.add(
387 "down",
388 filter=has_line_below & navigable_suggestions & has_focus(DEFAULT_BUFFER),
389 )(auto_suggest.down_and_update_hint)
387 390 kb.add("right", filter=has_suggestion & has_focus(DEFAULT_BUFFER))(
388 391 auto_suggest.accept_character
389 392 )
General Comments 0
You need to be logged in to leave comments. Login now