@@ -25,9 +25,12 @@ import qualified System.Process as P
25
25
statusDisplay
26
26
:: ( PostBuild t m
27
27
, MonadHold t m
28
+ , HasDisplayRegion t m
29
+ , HasImageWriter t m
30
+ , HasTheme t m
28
31
)
29
32
=> Ghci t
30
- -> VtyWidget t m ()
33
+ -> m ()
31
34
statusDisplay g = do
32
35
pb <- getPostBuild
33
36
text <=< hold " " $ leftmost
@@ -40,17 +43,24 @@ statusDisplay g = do
40
43
-- when there is additional content to view.
41
44
scrollableOutput
42
45
:: ( Reflex t
43
- , MonadNodeId m
44
- , MonadHold t m
46
+ , HasDisplayRegion t m
47
+ , HasFocus t m
48
+ , HasFocusReader t m
49
+ , HasImageWriter t m
50
+ , HasInput t m
51
+ , HasLayout t m
52
+ , HasTheme t m
45
53
, MonadFix m
54
+ , MonadHold t m
55
+ , MonadNodeId m
46
56
, PostBuild t m
47
57
)
48
58
=> Behavior t ByteString
49
- -> VtyWidget t m ()
59
+ -> m ()
50
60
scrollableOutput out = col $ do
51
61
dh <- displayHeight
52
- scroll <- stretch $ scrollableText never $ T. decodeUtf8 <$> out
53
- fixed 1 $ text $
62
+ scroll <- tile flex $ scrollableText never $ T. decodeUtf8 <$> out
63
+ grout ( fixed 1 ) $ text $
54
64
let f h (ix, n) = if n - ix + 1 > h
55
65
then " ↓ More ↓"
56
66
else " "
@@ -62,9 +72,13 @@ scrollingOutput
62
72
, Monad m
63
73
, MonadHold t m
64
74
, MonadFix m
75
+ , HasDisplayRegion t m
76
+ , HasInput t m
77
+ , HasImageWriter t m
78
+ , HasTheme t m
65
79
)
66
80
=> Dynamic t ByteString
67
- -> VtyWidget t m ()
81
+ -> m ()
68
82
scrollingOutput out = do
69
83
dh <- displayHeight
70
84
let scrollBy h (ix, n) =
@@ -82,15 +96,22 @@ ghciModuleStatus
82
96
, MonadHold t m
83
97
, MonadFix m
84
98
, Adjustable t m
99
+ , HasLayout t m
100
+ , HasImageWriter t m
101
+ , HasFocusReader t m
102
+ , HasDisplayRegion t m
103
+ , HasInput t m
104
+ , HasTheme t m
105
+ , HasFocus t m
85
106
)
86
107
=> Ghci t
87
- -> VtyWidget t m ()
108
+ -> m ()
88
109
ghciModuleStatus g = col $ do
89
110
let ghciExit = _process_exit $ _ghci_process g
90
111
ghciExited <- hold False $ True <$ ghciExit
91
- fixed 3 $ boxStatic def $ statusDisplay g
112
+ grout ( fixed 3 ) $ boxStatic def $ statusDisplay g
92
113
out <- moduleOutput (not <$> ghciExited) g
93
- stretch $ void $
114
+ tile flex $ void $
94
115
networkHold (scrollableOutput $ current out) $ ffor (_ghci_reload g) $
95
116
const $ scrollableOutput $ current out
96
117
@@ -99,9 +120,14 @@ ghciExecOutput
99
120
:: ( MonadHold t m
100
121
, MonadFix m
101
122
, Adjustable t m
123
+ , HasDisplayRegion t m
124
+ , HasInput t m
125
+ , HasImageWriter t m
126
+ , HasTheme t m
127
+ , HasInput t m
102
128
)
103
129
=> Ghci t
104
- -> VtyWidget t m ()
130
+ -> m ()
105
131
ghciExecOutput g = do
106
132
ghciExited <- hold False $ True <$ _process_exit (_ghci_process g)
107
133
out <- execOutput (not <$> ghciExited) g
@@ -117,9 +143,16 @@ ghciPanes
117
143
, MonadNodeId m
118
144
, PostBuild t m
119
145
, Adjustable t m
146
+ , HasInput t m
147
+ , HasImageWriter t m
148
+ , HasFocusReader t m
149
+ , HasDisplayRegion t m
150
+ , HasTheme t m
151
+ , HasLayout t m
152
+ , HasFocus t m
120
153
)
121
154
=> Ghci t
122
- -> VtyWidget t m ()
155
+ -> m ()
123
156
ghciPanes g = void $ splitVDrag
124
157
(hRule doubleBoxStyle)
125
158
(ghciModuleStatus g)
@@ -130,10 +163,11 @@ ghciPanes g = void $ splitVDrag
130
163
getExitEvent
131
164
:: ( PerformEvent t m
132
165
, MonadIO (Performable m )
166
+ , HasInput t m
133
167
)
134
168
=> Ghci t
135
169
-> Event t a
136
- -> VtyWidget t m (Event t () )
170
+ -> m (Event t () )
137
171
getExitEvent g externalExitReq = do
138
172
exitReq <- keyCombo (V. KChar ' c' , [V. MCtrl ])
139
173
let exitReqs = leftmost
0 commit comments