From c1a8e777606bc03cab10bb08247490785aa49215 Mon Sep 17 00:00:00 2001 From: sevin7676 Date: Fri, 28 Nov 2014 08:18:33 -0500 Subject: [PATCH] Add comment to explain unusual naming and remove ending whitespace --- lib/ace/mode/folding/cstyle.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ace/mode/folding/cstyle.js b/lib/ace/mode/folding/cstyle.js index c2f302c2..a98807ab 100644 --- a/lib/ace/mode/folding/cstyle.js +++ b/lib/ace/mode/folding/cstyle.js @@ -54,6 +54,8 @@ oop.inherits(FoldMode, BaseFoldMode); this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/; + + //prevent naming conflict with any modes that inherit from cstyle and override this (like csharp) this._getFoldWidgetBase = this.getFoldWidget; /** @@ -61,10 +63,10 @@ oop.inherits(FoldMode, BaseFoldMode); * * @example lineCommentRegionStart * //#region [optional description] - * + * * @example blockCommentRegionStart * /*#region [optional description] *[/] - * + * * @example tripleStarFoldingSection * /*** this folds even though 1 line because it has 3 stars ***[/] */ @@ -73,13 +75,13 @@ oop.inherits(FoldMode, BaseFoldMode); if (this.singleLineBlockCommentRe.test(line)) { // No widget for single line block comment unless region or triple star - if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) return ""; } var fw = this._getFoldWidgetBase(session, foldStyle, row); - if (!fw && this.startRegionRe.test(line)) + if (!fw && this.startRegionRe.test(line)) return "start"; // lineCommentRegionStart return fw;