summaryrefslogtreecommitdiffstats
path: root/src/CodeParserController.ts
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2018-10-20 15:19:30 +0200
committerChristoph Schlosser <christoph@linux.com>2018-10-20 15:19:30 +0200
commitdf3a5391f49dd3947354963dcf8a23e7ceec2b41 (patch)
treed229bea00a1e9d00da4684c9b29bfb2fdc47f285 /src/CodeParserController.ts
parent577687906fa80a4ddbad7ed57845a751b4dbacc3 (diff)
downloaddoxdocgen-df3a5391f49dd3947354963dcf8a23e7ceec2b41.tar.gz
Parse python with #
Diffstat (limited to 'src/CodeParserController.ts')
-rw-r--r--src/CodeParserController.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/CodeParserController.ts b/src/CodeParserController.ts
index 1dfc5c4..4e38f06 100644
--- a/src/CodeParserController.ts
+++ b/src/CodeParserController.ts
@@ -80,12 +80,15 @@ export default class CodeParserController {
// Do not trigger when there's whitespace after the trigger sequence
// tslint:disable-next-line:max-line-length
- const seq = "[\\s]*(" + this.cfg.C.triggerSequence.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + ")$";
+ const seq = "[\\s]*([" + this.cfg.C.triggerSequence.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + "]|[" + this.cfg.Python.triggerSequence.replace(/\#/g, "\\$&") + "])$";
const match: RegExpMatchArray = activeLine.text.match(seq);
if (match !== null) {
const cont: string = match[1];
- return this.cfg.C.triggerSequence === cont;
+ return (
+ this.cfg.C.triggerSequence === cont ||
+ cont === "#" // probably python
+ );
} else {
return false;
}