File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change 10
10
from prompt_toolkit .layout .controls import TokenListControl
11
11
from prompt_toolkit .layout .dimension import LayoutDimension as D
12
12
from prompt_toolkit .token import Token
13
+ from prompt_toolkit .shortcuts import create_prompt_application
13
14
from prompt_toolkit .styles import style_from_dict
14
15
15
16
@@ -47,15 +48,6 @@ def get_prompt_tokens(cli):
47
48
tokens .append ((Token .Instruction , instruction ))
48
49
return tokens
49
50
50
- # assemble layout
51
- # TODO this does not work without the HSplit??
52
- layout = HSplit ([
53
- Window (
54
- height = D .exact (1 ),
55
- content = TokenListControl (get_prompt_tokens , align_center = False ),
56
- )
57
- ])
58
-
59
51
# key bindings
60
52
manager = KeyBindingManager .for_prompt ()
61
53
@@ -81,8 +73,8 @@ def set_answer(event):
81
73
status ['answer' ] = default
82
74
event .cli .set_return_value (default )
83
75
84
- return Application (
85
- layout = layout ,
76
+ return create_prompt_application (
77
+ get_prompt_tokens = get_prompt_tokens ,
86
78
key_bindings_registry = manager .registry ,
87
79
mouse_support = False ,
88
80
style = style ,
You can’t perform that action at this time.
0 commit comments