diff options
| author | Christoph Schlosser <christoph@linux.com> | 2018-10-20 15:54:23 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2018-10-20 15:54:23 +0200 |
| commit | 5d64d00fe54d649d0519a3e9f018a1f71cee693b (patch) | |
| tree | b95cf36631668f7050a926cc827324ee26cec23c /src/CodeParserController.ts | |
| parent | df3a5391f49dd3947354963dcf8a23e7ceec2b41 (diff) | |
| download | doxdocgen-5d64d00fe54d649d0519a3e9f018a1f71cee693b.tar.gz | |
Get logical line for python function
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 4e38f06..a4b4748 100644 --- a/src/CodeParserController.ts +++ b/src/CodeParserController.ts @@ -114,15 +114,19 @@ export default class CodeParserController { } const lang: string = activeEditor.document.languageId; + const currentPos: Position = window.activeTextEditor.selection.active; let parser: CodeParser; + let endPos: number; switch (lang) { case "c": case "cpp": parser = new CppParser(this.cfg); + endPos = currentPos.character - this.cfg.C.triggerSequence.length; break; case "python": parser = new PythonParser(this.cfg); + endPos = currentPos.character - this.cfg.Python.triggerSequence.length; break; default: // tslint:disable-next-line:no-console @@ -130,10 +134,9 @@ export default class CodeParserController { return null; } - const currentPos: Position = window.activeTextEditor.selection.active; const startReplace: Position = new Position( currentPos.line, - currentPos.character - this.cfg.C.triggerSequence.length, + endPos, ); const nextLineText: string = window.activeTextEditor.document.lineAt(startReplace.line + 1).text; |