Delete records and stuff

This commit is contained in:
2026-02-12 11:43:52 -06:00
parent 200cb59b0e
commit 009d5701d2
6 changed files with 303 additions and 140 deletions

View File

@@ -269,6 +269,9 @@ func (w *TreeBrowser) ClearBorder() { w.border = []rune{}
func (w *TreeBrowser) SetOnChange(c func(*TreeNode) bool) { w.onChange = c }
func (w *TreeBrowser) SetOnSelect(s func(*TreeNode) bool) { w.onSelect = s }
func (w *TreeBrowser) SetVimMode(b bool) { w.vimMode = b }
func (w *TreeBrowser) GetNodeList() []*TreeNode { return w.nodes }
func (w *TreeBrowser) nmGetActiveNode() (*TreeNode, error) {
if len(w.listNodes) <= 0 {
return nil, errors.New("no nodes")
@@ -515,10 +518,16 @@ func (tn *TreeNode) GetLabelPath() []string {
var path []string
if tn.parent != nil {
path = tn.parent.GetLabelPath()
}
return append(path, tn.Label())
}
func (tn *TreeNode) GetValuePath() []string {
var path []string
if tn.parent != nil {
path = tn.parent.GetValuePath()
}
return append(path, tn.Value())
}
func (tn *TreeNode) getList() []string {
pre := strings.Repeat(tn.depthIndic, tn.Depth())
@@ -554,7 +563,10 @@ func (tn *TreeNode) SearchLabels(f string) *TreeNode {
return nil
}
func (tn *TreeNode) ToggleExpand() { tn.expanded = !tn.expanded }
func (tn *TreeNode) IsExpanded() bool { return tn.expanded }
func (tn *TreeNode) Expand() { tn.expanded = true }
func (tn *TreeNode) Collapse() { tn.expanded = false }
func (tn *TreeNode) ToggleExpand() { tn.expanded = !tn.expanded }
func (tn *TreeNode) AddChild(t *TreeNode, rest ...*TreeNode) {
if t.depthIndic == "" {