Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghc-debug
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Hrček
ghc-debug
Commits
a116e371
Commit
a116e371
authored
2 years ago
by
Joris Dral
Committed by
Matthew Pickering
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Keybindings for multi-expansion.
parent
53bfe1ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc-debug-brick/src/IOTree.hs
+16
-1
16 additions, 1 deletion
ghc-debug-brick/src/IOTree.hs
with
16 additions
and
1 deletion
ghc-debug-brick/src/IOTree.hs
+
16
−
1
View file @
a116e371
...
...
@@ -143,6 +143,7 @@ handleIOTreeEvent e tree
(
view'
,
cs
)
<-
viewExpand
view
return
$
if
null
cs
then
view'
else
viewUnsafeDown
view'
0
Vty
.
EvKey
KDown
_
->
return
$
next
view
Vty
.
EvKey
KLeft
[
Vty
.
MShift
]
->
return
$
viewCollapseAll
view
Vty
.
EvKey
KLeft
_
->
return
$
viewCollapse
$
fromMaybe
view
(
viewUp'
view
)
Vty
.
EvKey
KUp
_
->
return
$
prev
view
Vty
.
EvKey
KPageDown
_
->
return
$
List
.
foldl'
(
flip
(
$
))
view
(
replicate
15
next
)
...
...
@@ -282,7 +283,21 @@ viewCollapse t = case t of
Left
_
->
t
Right
cs
->
Node
mkParent
i
t'
{
_children
=
Left
(
return
cs
)}
-- | Expand the current node. Returns the children
-- | Collapse the current node and all the nodes in the the subtree rooted at
-- the current node.
viewCollapseAll
::
HasCallStack
=>
IOTreeView
node
name
->
IOTreeView
node
name
viewCollapseAll
tv
=
case
tv
of
Root
t
->
Root
(
t
{
_roots
=
fmap
go
(
_roots
t
)})
Node
mkParent
i
t
->
case
_children
t
of
Left
cs
->
Node
mkParent
i
t
{
_children
=
Left
$
fmap
go
<$>
cs
}
Right
cs
->
Node
mkParent
i
t
{
_children
=
Left
.
pure
$
fmap
go
cs
}
where
go
::
IOTreeNode
node
name
->
IOTreeNode
node
name
go
tn
=
case
_children
tn
of
Left
cs
->
tn
{
_children
=
Left
$
fmap
go
<$>
cs
}
Right
cs
->
tn
{
_children
=
Left
.
pure
$
fmap
go
cs
}
-- | Expand the current node. Returns the children of the current node.
viewExpand
::
HasCallStack
=>
IOTreeView
node
name
->
IO
(
IOTreeView
node
name
,
[
IOTreeNode
node
name
])
viewExpand
t
=
case
t
of
Root
t'
->
return
(
t
,
_roots
t'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment