|
|
@ -38,6 +38,7 @@ var (
|
|
|
|
addNewNode = fmt.Sprintf(RedColor, "a", " add new node")
|
|
|
|
addNewNode = fmt.Sprintf(RedColor, "a", " add new node")
|
|
|
|
addNewValue = fmt.Sprintf(RedColor, "A", " add new value")
|
|
|
|
addNewValue = fmt.Sprintf(RedColor, "A", " add new value")
|
|
|
|
clearChildrenNodes = fmt.Sprintf(RedColor, "d", " clear children nodes")
|
|
|
|
clearChildrenNodes = fmt.Sprintf(RedColor, "d", " clear children nodes")
|
|
|
|
|
|
|
|
editNodes = fmt.Sprintf(RedColor, "e", " edit json with $EDITOR(only when use --url)")
|
|
|
|
editNodeValue = fmt.Sprintf(RedColor, "Enter", "edit current node")
|
|
|
|
editNodeValue = fmt.Sprintf(RedColor, "Enter", "edit current node")
|
|
|
|
searchNodes = fmt.Sprintf(RedColor, "/", " search nodes")
|
|
|
|
searchNodes = fmt.Sprintf(RedColor, "/", " search nodes")
|
|
|
|
toggleExpandNodes = fmt.Sprintf(RedColor, "space", " expand/collaspe nodes")
|
|
|
|
toggleExpandNodes = fmt.Sprintf(RedColor, "space", " expand/collaspe nodes")
|
|
|
@ -45,7 +46,7 @@ var (
|
|
|
|
movePreParentNode = fmt.Sprintf(RedColor, "ctrl-k", "move to previous parent node")
|
|
|
|
movePreParentNode = fmt.Sprintf(RedColor, "ctrl-k", "move to previous parent node")
|
|
|
|
treeNavi = strings.Join([]string{hideNode, collaspeAllNode, expandNode, expandAllNode,
|
|
|
|
treeNavi = strings.Join([]string{hideNode, collaspeAllNode, expandNode, expandAllNode,
|
|
|
|
readFile, saveFile, addNewNode, addNewValue, clearChildrenNodes, editNodeValue, searchNodes,
|
|
|
|
readFile, saveFile, addNewNode, addNewValue, clearChildrenNodes, editNodeValue, searchNodes,
|
|
|
|
moveNextParentNode, movePreParentNode}, "\n")
|
|
|
|
moveNextParentNode, movePreParentNode, editNodes}, "\n")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type Navi struct {
|
|
|
|
type Navi struct {
|
|
|
@ -60,7 +61,7 @@ func NewNavi() *Navi {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (n *Navi) UpdateView() {
|
|
|
|
func (n *Navi) UpdateView() {
|
|
|
|
navi := strings.Join([]string{"", defaultNavi, "", treeNavi}, "\n")
|
|
|
|
navi := strings.Join([]string{defaultNavi, "", treeNavi}, "\n")
|
|
|
|
n.SetText(navi)
|
|
|
|
n.SetText(navi)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|