From df3a5391f49dd3947354963dcf8a23e7ceec2b41 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Sat, 20 Oct 2018 15:19:30 +0200 Subject: Parse python with # --- src/CodeParserController.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/CodeParserController.ts') 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; } -- cgit v1.2.3