File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1633,6 +1633,7 @@ var CodeMirror = (function() {
16331633 highlight : function ( mode , state ) {
16341634 var stream = new StringStream ( this . text ) , st = this . styles , pos = 0 ;
16351635 var changed = false , curWord = st [ 0 ] , prevWord ;
1636+ if ( this . text == "" && mode . blankLine ) mode . blankLine ( state ) ;
16361637 while ( ! stream . eol ( ) ) {
16371638 var style = mode . token ( stream , state ) ;
16381639 var substr = this . text . slice ( stream . start , stream . pos ) ;
Original file line number Diff line number Diff line change @@ -625,6 +625,12 @@ <h2 id="modeapi">Writing CodeMirror Modes</h2>
625625 CSS class string, or < code > null</ code > for tokens that do not have
626626 to be styled.< p >
627627
628+ < p id ="blankLine "> By default, blank lines are simply skipped when
629+ tokenizing a document. For languages that have significant blank
630+ lines, you can define a < code > blankLine(state)</ code > method on
631+ your mode that will get called whenever a blank line is passed
632+ over, so that it can update the parser state.</ p >
633+
628634 < p id ="StringStream "> The stream object encapsulates a line of code
629635 (tokens may never span lines) and our current position in that
630636 line. It has the following API:</ p >
You can’t perform that action at this time.
0 commit comments