Create an `Application` instance.
(
self, input: Input | None, output: Output | None
)
| 898 | ] |
| 899 | |
| 900 | def _create_application( |
| 901 | self, input: Input | None, output: Output | None |
| 902 | ) -> Application[str]: |
| 903 | """ |
| 904 | Create an `Application` instance. |
| 905 | """ |
| 906 | return Application( |
| 907 | layout=self.ptpython_layout.layout, |
| 908 | key_bindings=merge_key_bindings( |
| 909 | [ |
| 910 | load_python_bindings(self), |
| 911 | load_auto_suggest_bindings(), |
| 912 | load_sidebar_bindings(self), |
| 913 | load_confirm_exit_bindings(self), |
| 914 | ConditionalKeyBindings( |
| 915 | load_open_in_editor_bindings(), |
| 916 | Condition(lambda: self.enable_open_in_editor), |
| 917 | ), |
| 918 | # Extra key bindings should not be active when the sidebar is visible. |
| 919 | ConditionalKeyBindings( |
| 920 | self.extra_key_bindings, |
| 921 | Condition(lambda: not self.show_sidebar), |
| 922 | ), |
| 923 | ] |
| 924 | ), |
| 925 | color_depth=lambda: self.color_depth, |
| 926 | paste_mode=Condition(lambda: self.paste_mode), |
| 927 | mouse_support=Condition(lambda: self.enable_mouse_support), |
| 928 | style=DynamicStyle(lambda: self._current_style), |
| 929 | style_transformation=self.style_transformation, |
| 930 | include_default_pygments_style=False, |
| 931 | reverse_vi_search_direction=True, |
| 932 | cursor=DynamicCursorShapeConfig( |
| 933 | lambda: self.all_cursor_shape_configs[self.cursor_shape_config] |
| 934 | ), |
| 935 | input=input, |
| 936 | output=output, |
| 937 | ) |
| 938 | |
| 939 | def _create_buffer(self) -> Buffer: |
| 940 | """ |
no test coverage detected