use spacebar to expand/collaspe nodes

develop 1.1.0
skanehira 5 years ago
parent 41180768c1
commit 0ef94ac826

@ -30,7 +30,7 @@ $ tson -url http://gorilla/likes/json
### JSON tree ### JSON tree
| key | description | | key | description |
|--------|----------------------| |--------|--------------------------------|
| j | move down | | j | move down |
| k | move up | | k | move up |
| g | move to the top | | g | move to the top |
@ -49,6 +49,8 @@ $ tson -url http://gorilla/likes/json
| Enter | edit node | | Enter | edit node |
| / | search nodes | | / | search nodes |
| ? | show helps | | ? | show helps |
| space | expand/collaspe children nodes |
| ctrl-c | exit tson |
### help ### help
| key | description | | key | description |

@ -151,6 +151,9 @@ func (t *Tree) SetKeybindings(g *Gui) {
g.AddValue() g.AddValue()
case '?': case '?':
g.NaviPanel() g.NaviPanel()
case ' ':
current := t.GetCurrentNode()
current.SetExpanded(!current.IsExpanded())
} }
return event return event

Loading…
Cancel
Save