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