File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed
src/prompt_toolkit/shortcuts Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 1414from prompt_toolkit .key_binding .bindings .focus import focus_next , focus_previous
1515from prompt_toolkit .key_binding .defaults import load_key_bindings
1616from prompt_toolkit .key_binding .key_bindings import KeyBindings , merge_key_bindings
17- from prompt_toolkit .layout import Layout
17+ from prompt_toolkit .layout import Layout , Float , FloatContainer
1818from prompt_toolkit .layout .containers import AnyContainer , HSplit
1919from prompt_toolkit .layout .dimension import Dimension as D
20+ from prompt_toolkit .layout .menus import CompletionsMenu
2021from prompt_toolkit .styles import BaseStyle
2122from prompt_toolkit .validation import Validator
2223from prompt_toolkit .widgets import (
@@ -143,10 +144,28 @@ def ok_handler() -> None:
143144 body = HSplit (
144145 [
145146 Label (text = text , dont_extend_height = True ),
146- textfield ,
147- ValidationToolbar (),
147+ FloatContainer (
148+ HSplit (
149+ [
150+ textfield
151+ ],
152+ height = D (min = 8 , preferred = 10 , max = 16 )
153+ ),
154+ [
155+ Float (
156+ xcursor = True ,
157+ ycursor = True ,
158+ transparent = True ,
159+ content = CompletionsMenu (
160+ max_height = 16 ,
161+ scroll_offset = 1
162+ )
163+ )
164+ ]
165+ ),
166+ ValidationToolbar ()
148167 ],
149- padding = D (preferred = 1 , max = 1 ),
168+ padding = D (preferred = 1 , max = 1 )
150169 ),
151170 buttons = [ok_button , cancel_button ],
152171 with_background = True ,
You can’t perform that action at this time.
0 commit comments