diff options
Diffstat (limited to 'src/CodeParserController.ts')
| -rw-r--r-- | src/CodeParserController.ts | 7 |
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; } |