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 14
14
from prompt_toolkit .key_binding .bindings .focus import focus_next , focus_previous
15
15
from prompt_toolkit .key_binding .defaults import load_key_bindings
16
16
from 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
18
18
from prompt_toolkit .layout .containers import AnyContainer , HSplit
19
19
from prompt_toolkit .layout .dimension import Dimension as D
20
+ from prompt_toolkit .layout .menus import CompletionsMenu
20
21
from prompt_toolkit .styles import BaseStyle
21
22
from prompt_toolkit .validation import Validator
22
23
from prompt_toolkit .widgets import (
@@ -143,10 +144,28 @@ def ok_handler() -> None:
143
144
body = HSplit (
144
145
[
145
146
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 ()
148
167
],
149
- padding = D (preferred = 1 , max = 1 ),
168
+ padding = D (preferred = 1 , max = 1 )
150
169
),
151
170
buttons = [ok_button , cancel_button ],
152
171
with_background = True ,
You can’t perform that action at this time.
0 commit comments