Scripting: Fix member docstrings with newlines

This commit is contained in:
Vicki Pfau 2022-09-29 02:52:57 -07:00
parent 0c33863e66
commit 7719dd5ec4
1 changed files with 6 additions and 1 deletions

View File

@ -230,7 +230,12 @@ void explainClass(struct mScriptTypeClass* cls, int level) {
case mSCRIPT_CLASS_INIT_INSTANCE_MEMBER:
fprintf(out, "%s %s:\n", indent, details->info.member.name);
if (docstring) {
fprintf(out, "%s comment: \"%s\"\n", indent, docstring);
if (strchr(docstring, '\n')) {
fprintf(out, "%s comment: |-\n", indent);
printchomp(docstring, level + 3);
} else {
fprintf(out, "%s comment: \"%s\"\n", indent, docstring);
}
docstring = NULL;
}
fprintf(out, "%s type: %s\n", indent, details->info.member.type->name);