File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -149,17 +149,18 @@ CodeMirror.defineMode("ruby", function(config) {
149149 }
150150 }
151151
152- function tokenBaseUntilBrace ( ) {
153- var depth = 1 ;
152+ function tokenBaseUntilBrace ( depth ) {
153+ if ( ! depth ) depth = 1 ;
154154 return function ( stream , state ) {
155155 if ( stream . peek ( ) == "}" ) {
156- depth -- ;
157- if ( depth == 0 ) {
156+ if ( depth == 1 ) {
158157 state . tokenize . pop ( ) ;
159158 return state . tokenize [ state . tokenize . length - 1 ] ( stream , state ) ;
159+ } else {
160+ state . tokenize [ state . tokenize . length - 1 ] = tokenBaseUntilBrace ( depth - 1 ) ;
160161 }
161162 } else if ( stream . peek ( ) == "{" ) {
162- depth ++ ;
163+ state . tokenize [ state . tokenize . length - 1 ] = tokenBaseUntilBrace ( depth + 1 ) ;
163164 }
164165 return tokenBase ( stream , state ) ;
165166 } ;
You can’t perform that action at this time.
0 commit comments