MCPcopy
hub / github.com/micro-editor/micro / drawNode

Method drawNode

internal/display/uiwindow.go:21–50  ·  view source on GitHub ↗
(n *views.Node)

Source from the content-addressed store, hash-verified

19}
20
21func (w *UIWindow) drawNode(n *views.Node) {
22 cs := n.Children()
23 dividerStyle := config.DefStyle
24 if style, ok := config.Colorscheme["divider"]; ok {
25 dividerStyle = style
26 }
27
28 divchars := config.GetGlobalOption("divchars").(string)
29 if util.CharacterCountInString(divchars) != 2 {
30 divchars = "|-"
31 }
32
33 divchar, combc, _ := util.DecodeCharacterInString(divchars)
34
35 divreverse := config.GetGlobalOption("divreverse").(bool)
36 if divreverse {
37 dividerStyle = dividerStyle.Reverse(true)
38 }
39
40 for i, c := range cs {
41 if c.Kind == views.STVert {
42 if i != len(cs)-1 {
43 for h := 0; h < c.H; h++ {
44 screen.SetContent(c.X+c.W, c.Y+h, divchar, combc, dividerStyle)
45 }
46 }
47 }
48 w.drawNode(c)
49 }
50}
51
52func (w *UIWindow) Display() {
53 w.drawNode(w.root)

Callers 1

DisplayMethod · 0.95

Calls 5

GetGlobalOptionFunction · 0.92
CharacterCountInStringFunction · 0.92
DecodeCharacterInStringFunction · 0.92
SetContentFunction · 0.92
ChildrenMethod · 0.80

Tested by

no test coverage detected