MCPcopy Create free account
hub / github.com/B33pBeeps/redthread / Split

Method Split

internal/app/edit.go:80–95  ·  view source on GitHub ↗

Split returns the live (title, body) from the textarea content. First non-empty line is the title; the rest (skipping one separator blank) is the body.

()

Source from the content-addressed store, hash-verified

78// non-empty line is the title; the rest (skipping one separator blank)
79// is the body.
80func (e *Editor) Split() (string, string) {
81 val := e.Ta.Value()
82 lines := strings.SplitN(val, "\n", 2)
83 if len(lines) == 0 {
84 return "", ""
85 }
86 title := strings.TrimSpace(lines[0])
87 if len(lines) == 1 {
88 return title, ""
89 }
90 rest := lines[1]
91 if strings.HasPrefix(rest, "\n") {
92 rest = rest[1:]
93 }
94 return title, rest
95}
96
97// View composes: blurred backdrop → ornate canvas frame at target rect →
98// textarea spliced inside the frame → footer.

Callers 3

ViewMethod · 0.95
handleEditKeyMethod · 0.80
wrapLinesFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected