more attempts

This commit is contained in:
Jeff Carr 2025-03-29 21:36:58 -05:00
parent 12b8c5603b
commit 41bac3da7b
1 changed files with 22 additions and 6 deletions

View File

@ -342,10 +342,12 @@ func formatEnum(curmsg *FormatMsg) []string {
if argv.Debug { if argv.Debug {
header := fmt.Sprintf("%s%s // enum2 depth=%d", curmsg.padBase(), curmsg.Header, curmsg.Depth) header := fmt.Sprintf("%s%s // enum2 depth=%d", curmsg.padBase(), curmsg.Header, curmsg.Depth)
newmsg = append(newmsg, header) newmsg = append(newmsg, header)
header = fmt.Sprintf("//%s//%s// enum2 depth=%d", curmsg.padding(2), curmsg.Header, curmsg.Depth) /*
newmsg = append(newmsg, header) header = fmt.Sprintf("//%s//%s// enum2 depth=%d", curmsg.padding(2), curmsg.Header, curmsg.Depth)
header = fmt.Sprintf("// %s", curmsg.Header) newmsg = append(newmsg, header)
newmsg = append(newmsg, header) header = fmt.Sprintf("// %s", curmsg.Header)
newmsg = append(newmsg, header)
*/
} else { } else {
header := fmt.Sprintf("%s%s", curmsg.padBase(), curmsg.Header) header := fmt.Sprintf("%s%s", curmsg.padBase(), curmsg.Header)
newmsg = append(newmsg, header) newmsg = append(newmsg, header)
@ -411,7 +413,16 @@ func formatMessage(curmsg *FormatMsg) []string {
var newmsg []string var newmsg []string
// add the notes & comments before the header // add the notes & comments before the header
newmsg = append(newmsg, strings.TrimSpace(strings.Join(curmsg.Notes, "\n"))) // newmsg = append(newmsg, strings.TrimSpace(strings.Join(curmsg.Notes, "\n")))
for _, line := range strings.Split(strings.TrimSpace(strings.Join(curmsg.Notes, "\n")), "\n") {
if argv.Debug {
footer := fmt.Sprintf("%s%s // msg notes footer depth=%d", curmsg.padBase(), line, curmsg.Depth)
newmsg = append(newmsg, footer)
} else {
footer := fmt.Sprintf("%s%s", curmsg.padBase(), line)
newmsg = append(newmsg, footer)
}
}
if curmsg.Header != "" { if curmsg.Header != "" {
var line string var line string
@ -453,7 +464,12 @@ func formatMessage(curmsg *FormatMsg) []string {
case FormatMsg_ENUM: case FormatMsg_ENUM:
for _, line := range formatEnum(msg) { for _, line := range formatEnum(msg) {
// line = fmt.Sprintf("%s%s", curmsg.pad(), line) // line = fmt.Sprintf("%s%s", curmsg.pad(), line)
newmsg = append(newmsg, line) line = strings.TrimSpace(line)
if argv.Debug {
line = fmt.Sprintf("%s%s // msg depth=%d", msg.padBase(), line, msg.Depth)
} else {
line = fmt.Sprintf("%s%s", msg.padBase(), line)
}
} }
case FormatMsg_MESSAGE: case FormatMsg_MESSAGE:
for _, line := range msg.format() { for _, line := range msg.format() {