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

Function composeEditorValue

internal/app/edit.go:39–47  ·  view source on GitHub ↗

composeEditorValue builds the textarea seed text. Empty notes seed as an empty string so the cursor lands on row 1, not row 3.

(title, body string)

Source from the content-addressed store, hash-verified

37// composeEditorValue builds the textarea seed text. Empty notes seed as
38// an empty string so the cursor lands on row 1, not row 3.
39func composeEditorValue(title, body string) string {
40 if title == "" && body == "" {
41 return ""
42 }
43 if body == "" {
44 return title
45 }
46 return title + "\n\n" + body
47}
48
49func editBodyWidth(rect Rect) int {
50 w := rect.W - 4

Callers 1

NewEditorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected