From 7a020595526eeb03ec6ab867372da97a2a38e258 Mon Sep 17 00:00:00 2001 From: kasecato Date: Mon, 27 Jul 2020 20:55:54 +0900 Subject: [PATCH] Fixed #98 insert line below --- CHANGELOG.md | 4 ++++ src/Domain/Lang/DocommentDomainCSharp.ts | 2 +- src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee64f8a..2831cb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 0.1.16 (July 27, 2020) + +* bug fix - ctrl-enter (insert line below, insert line above) in middle of line not adding `///`. See [#98](https://github.com/kasecato/vscode-docomment/issues/98). + ## 0.1.15 (July 26, 2020) * bug fix - ctrl-enter (insert line below, insert line above) in middle of line not adding `///`. See [#98](https://github.com/kasecato/vscode-docomment/issues/98). diff --git a/src/Domain/Lang/DocommentDomainCSharp.ts b/src/Domain/Lang/DocommentDomainCSharp.ts index 2234de9..f1e4cea 100644 --- a/src/Domain/Lang/DocommentDomainCSharp.ts +++ b/src/Domain/Lang/DocommentDomainCSharp.ts @@ -41,7 +41,7 @@ export class DocommentDomainCSharp extends DocommentDomain { // NG: KeyCode is NOT '/' or Enter const isActivationKey: boolean = SyntacticAnalysisCSharp.IsActivationKey(activeChar, this._config.syntax); - const isEnterKey: boolean = SyntacticAnalysisCSharp.IsEnterKey(activeChar, eventText); + const isEnterKey: boolean = SyntacticAnalysisCSharp.IsEnterKey(eventText); if (!isActivationKey && !isEnterKey) { return false; } diff --git a/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts b/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts index 8741958..e54d85b 100644 --- a/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts +++ b/src/SyntacticAnalysis/SyntacticAnalysisCSharp.ts @@ -12,8 +12,8 @@ export class SyntacticAnalysisCSharp { /*------------------------------------------------------------------------- * Public Method: Comment Type *-----------------------------------------------------------------------*/ - public static IsEnterKey(activeChar: string, text: string): boolean { - return (activeChar === '') && (text.startsWith('\n') || text.startsWith("\r\n")); + public static IsEnterKey(text: string): boolean { + return (text.startsWith('\n') || text.startsWith("\r\n")); } public static IsInsertLineAbove(activeLine: string): boolean {