use spacebar to expand/collaspe nodes

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

@ -29,26 +29,28 @@ $ tson -url http://gorilla/likes/json
## Keybinding
### JSON tree
| key | description |
|--------|----------------------|
| j | move down |
| k | move up |
| g | move to the top |
| G | move to the bottom |
| ctrl-f | page up |
| ctrl-b | page down |
| h | hide current node |
| H | collaspe all nodes |
| l | expand current node |
| L | expand all nodes |
| r | read from file |
| s | save to file |
| a | add new node |
| A | add new value |
| d | clear children nodes |
| Enter | edit node |
| / | search nodes |
| ? | show helps |
| key | description |
|--------|--------------------------------|
| j | move down |
| k | move up |
| g | move to the top |
| G | move to the bottom |
| ctrl-f | page up |
| ctrl-b | page down |
| h | hide current node |
| H | collaspe all nodes |
| l | expand current node |
| L | expand all nodes |
| r | read from file |
| s | save to file |
| a | add new node |
| A | add new value |
| d | clear children nodes |
| Enter | edit node |
| / | search nodes |
| ? | show helps |
| space | expand/collaspe children nodes |
| ctrl-c | exit tson |
### help
| key | description |

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

Loading…
Cancel
Save