33 *
44 * Copyright (c) 2010, Ajax.org B.V.
55 * All rights reserved.
6- *
6+ *
77 * Redistribution and use in source and binary forms, with or without
88 * modification, are permitted provided that the following conditions are met:
99 * * Redistributions of source code must retain the above copyright
1414 * * Neither the name of Ajax.org B.V. nor the
1515 * names of its contributors may be used to endorse or promote products
1616 * derived from this software without specific prior written permission.
17- *
17+ *
1818 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1919 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2020 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -42,7 +42,7 @@ oop.inherits(FoldMode, BaseFoldMode);
4242
4343 this . foldingStartMarker = / ( \{ | \[ ) [ ^ \} \] ] * $ | ^ \s * ( \/ \* ) / ;
4444 this . foldingStopMarker = / ^ [ ^ \[ \{ ] * ( \} | \] ) | ^ [ \s \* ] * ( \* \/ ) / ;
45-
45+
4646 this . getFoldWidgetRange = function ( session , foldStyle , row ) {
4747 var line = session . getLine ( row ) ;
4848 var match = line . match ( this . foldingStartMarker ) ;
@@ -59,7 +59,7 @@ oop.inherits(FoldMode, BaseFoldMode);
5959
6060 if ( foldStyle !== "markbeginend" )
6161 return ;
62-
62+
6363 var match = line . match ( this . foldingStopMarker ) ;
6464 if ( match ) {
6565 var i = match . index + match [ 0 ] . length ;
@@ -70,19 +70,10 @@ oop.inherits(FoldMode, BaseFoldMode);
7070 return range ;
7171 }
7272
73- var end = { row : row , column : i } ;
74- var start = session . $findOpeningBracket ( match [ 1 ] , end ) ;
75-
76- if ( ! start )
77- return ;
78-
79- start . column ++ ;
80- end . column -- ;
81-
82- return Range . fromPoints ( start , end ) ;
73+ return this . closingBracketBlock ( session , match [ 1 ] , row , i ) ;
8374 }
8475 } ;
85-
76+
8677} ) . call ( FoldMode . prototype ) ;
8778
8879} ) ;
0 commit comments