summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2019-06-22 18:39:58 +0200
committerChristoph Schlosser <christoph@linux.com>2019-06-22 18:39:58 +0200
commit61bc1fafb3778e12afafa41757c14f4360a9c663 (patch)
tree0623529b4eb3e71d02c07cc343be4d4992bae6c3
parent2f358e66df977d696335816876fad7e759efcb8e (diff)
downloaddoxdocgen-61bc1fafb3778e12afafa41757c14f4360a9c663.tar.gz
Enable indent also for return
-rw-r--r--src/Lang/Cpp/CppDocGen.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Lang/Cpp/CppDocGen.ts b/src/Lang/Cpp/CppDocGen.ts
index 51a975f..eb2f01a 100644
--- a/src/Lang/Cpp/CppDocGen.ts
+++ b/src/Lang/Cpp/CppDocGen.ts
@@ -122,7 +122,8 @@ export class CppDocGen implements IDocGen {
protected getTemplatedString(replace: string, template: string, param: string, indent: boolean = false): string {
let indentWidth: string = "";
if (indent === true) {
- const numSpaces = Math.max(this.cfg.Generic.indentWidth - param.length, 0);
+ const replacedTemplate = template.replace(replace, param);
+ const numSpaces = Math.max(this.cfg.Generic.indentWidth - replacedTemplate.length, 0);
indentWidth = " ".repeat(numSpaces);
}
const indentedTemplate = template.replace(replace, replace + indentWidth);
@@ -435,7 +436,8 @@ export class CppDocGen implements IDocGen {
if (this.cfg.Generic.returnTemplate.trim().length !== 0 && this.func.type !== null) {
const returnParams = this.generateReturnParams();
// tslint:disable-next-line:max-line-length
- this.generateFromTemplate(lines, this.cfg.typeTemplateReplace, this.cfg.Generic.returnTemplate, returnParams);
+ this.generateFromTemplate(lines, this.cfg.typeTemplateReplace, this.cfg.Generic.returnTemplate, returnParams,
+ true);
}
break;
}