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 ## Keybinding
### 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 |
| G | move to the bottom | | G | move to the bottom |
| ctrl-f | page up | | ctrl-f | page up |
| ctrl-b | page down | | ctrl-b | page down |
| h | hide current node | | h | hide current node |
| H | collaspe all nodes | | H | collaspe all nodes |
| l | expand current node | | l | expand current node |
| L | expand all nodes | | L | expand all nodes |
| r | read from file | | r | read from file |
| s | save to file | | s | save to file |
| a | add new node | | a | add new node |
| A | add new value | | A | add new value |
| d | clear children nodes | | d | clear children nodes |
| 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