File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 2222from prompt_toolkit .enums import EditingMode
2323from prompt_toolkit .key_binding import KeyBindings
2424from prompt_toolkit .filters import Condition
25+ from prompt_toolkit .layout import Float , FloatContainer
26+ from prompt_toolkit .widgets import Dialog , Button , Label
2527from sys import version_info
2628import contextlib
2729import pathlib
@@ -120,7 +122,7 @@ def double_quotation(event):
120122 b .insert_text ('"' , move_cursor = False )
121123
122124
123- # Add an additional key binding for toggling this flag.
125+ # Add an additional key binding for toggling the Edit mode flag.
124126@bindings .add ("f4" )
125127def _editor_toggle (event ):
126128 """Toggle between Emacs and Vi mode."""
@@ -132,7 +134,14 @@ def _editor_toggle(event):
132134 app .editing_mode = EditingMode .VI
133135
134136
135- # Add an additional key binding for toggling this flag.
137+ @bindings .add ("f1" )
138+ def _toggle_help (event ):
139+ """Toggles bottom bar from showing help or showing information"""
140+ app = event .app
141+ app .help_mode = not app .help_mode
142+
143+
144+ # Add an additional key binding for toggling the braces completion flag.
136145@bindings .add ("f3" )
137146def _group_autocomplete_toggle (event ):
138147 """Complete braces."""
Original file line number Diff line number Diff line change @@ -161,6 +161,11 @@ def bottom_toolbar(self):
161161 # TODO: Figure out how allow user-customization
162162 app = get_app ()
163163 edit_mode = "Vi" if app .editing_mode == EditingMode .VI else "Emacs"
164+ if not hasattr (app , "help_mode" ):
165+ app .help_mode = False
166+
167+ if app .help_mode :
168+ return HTML (f" f1: help, f2: " )
164169
165170 # The first time around, app.group_autocomplete has not been set,
166171 # so use the value from Settings`GroupAutocomplete.
You can’t perform that action at this time.
0 commit comments