mirror of
https://github.com/mum4k/termdash.git
synced 2025-04-25 13:48:50 +08:00
Minor fixes for linting errors
This commit is contained in:
parent
2c8f554031
commit
cd6f571a1b
@ -1,4 +1,3 @@
|
||||
// options.go
|
||||
package treeview
|
||||
|
||||
import "github.com/mum4k/termdash/cell"
|
||||
|
@ -1,4 +1,3 @@
|
||||
// treeview.go
|
||||
package treeview
|
||||
|
||||
import (
|
||||
@ -20,8 +19,9 @@ import (
|
||||
"github.com/mum4k/termdash/widgetapi"
|
||||
)
|
||||
|
||||
// Number of nodes to scroll per mouse wheel event
|
||||
const (
|
||||
ScrollStep = 5 // Number of nodes to scroll per mouse wheel event
|
||||
ScrollStep = 5
|
||||
)
|
||||
|
||||
// TreeNode represents a node in the treeview.
|
||||
@ -259,16 +259,17 @@ func (tv *Treeview) getVisibleNodesList() []*TreeNode {
|
||||
func (tv *Treeview) getNodePrefix(node *TreeNode) string {
|
||||
if node.GetShowSpinner() && len(tv.waitingIcons) > 0 {
|
||||
return tv.waitingIcons[node.SpinnerIndex]
|
||||
} else if len(node.Children) > 0 {
|
||||
}
|
||||
|
||||
if len(node.Children) > 0 {
|
||||
if node.ExpandedState {
|
||||
return tv.expandedIcon
|
||||
} else {
|
||||
}
|
||||
return tv.collapsedIcon
|
||||
}
|
||||
} else {
|
||||
|
||||
return tv.leafIcon
|
||||
}
|
||||
}
|
||||
|
||||
// drawNode draws nodes based on the nodesToDraw slice.
|
||||
func (tv *Treeview) drawNode(cvs *canvas.Canvas, nodesToDraw []*TreeNode) error {
|
||||
|
Loading…
x
Reference in New Issue
Block a user