diff --git a/mode/ebnf/ebnf.js b/mode/ebnf/ebnf.js index 6b51aba07e..9618f8e42b 100644 --- a/mode/ebnf/ebnf.js +++ b/mode/ebnf/ebnf.js @@ -94,7 +94,7 @@ if (bracesMode !== null && (state.braced || peek === "{")) { if (state.localState === null) - state.localState = bracesMode.startState(); + state.localState = CodeMirror.startState(bracesMode); var token = bracesMode.token(stream, state.localState), text = stream.current(); diff --git a/mode/haml/haml.js b/mode/haml/haml.js index 86def73ebb..20ae1e19ca 100644 --- a/mode/haml/haml.js +++ b/mode/haml/haml.js @@ -98,8 +98,8 @@ return { // default to html mode startState: function() { - var htmlState = htmlMode.startState(); - var rubyState = rubyMode.startState(); + var htmlState = CodeMirror.startState(htmlMode); + var rubyState = CodeMirror.startState(rubyMode); return { htmlState: htmlState, rubyState: rubyState, diff --git a/mode/htmlmixed/htmlmixed.js b/mode/htmlmixed/htmlmixed.js index 6574fbd569..d74083ee1a 100644 --- a/mode/htmlmixed/htmlmixed.js +++ b/mode/htmlmixed/htmlmixed.js @@ -115,7 +115,7 @@ return { startState: function () { - var state = htmlMode.startState(); + var state = CodeMirror.startState(htmlMode); return {token: html, inTag: null, localMode: null, localState: null, htmlState: state}; }, diff --git a/mode/jade/jade.js b/mode/jade/jade.js index 1db069a90e..51ed105aca 100644 --- a/mode/jade/jade.js +++ b/mode/jade/jade.js @@ -36,7 +36,7 @@ CodeMirror.defineMode('jade', function (config) { this.isInterpolating = false; this.interpolationNesting = 0; - this.jsState = jsMode.startState(); + this.jsState = CodeMirror.startState(jsMode); this.restOfLine = ''; @@ -386,7 +386,7 @@ CodeMirror.defineMode('jade', function (config) { if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) { if (stream.peek() === '=' || stream.peek() === '!') { state.inAttributeName = false; - state.jsState = jsMode.startState(); + state.jsState = CodeMirror.startState(jsMode); if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') { state.attributeIsType = true; } else { @@ -492,7 +492,7 @@ CodeMirror.defineMode('jade', function (config) { if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) { if (state.innerMode) { if (!state.innerState) { - state.innerState = state.innerMode.startState ? state.innerMode.startState(stream.indentation()) : {}; + state.innerState = state.innerMode.startState ? CodeMirror.startState(state.innerMode, stream.indentation()) : {}; } return stream.hideFirstChars(state.indentOf + 2, function () { return state.innerMode.token(stream, state.innerState) || true; diff --git a/mode/markdown/markdown.js b/mode/markdown/markdown.js index 8995fd5f5a..fd8f647fd2 100644 --- a/mode/markdown/markdown.js +++ b/mode/markdown/markdown.js @@ -218,7 +218,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { state.fencedChars = match[1] // try switching mode state.localMode = getMode(match[2]); - if (state.localMode) state.localState = state.localMode.startState(); + if (state.localMode) state.localState = CodeMirror.startState(state.localMode); state.f = state.block = local; if (modeCfg.highlightFormatting) state.formatting = "code-block"; state.code = -1 diff --git a/mode/pegjs/pegjs.js b/mode/pegjs/pegjs.js index 8e87b59eca..6c72074666 100644 --- a/mode/pegjs/pegjs.js +++ b/mode/pegjs/pegjs.js @@ -81,7 +81,7 @@ CodeMirror.defineMode("pegjs", function (config) { return "comment"; } else if (state.braced || stream.peek() === '{') { if (state.localState === null) { - state.localState = jsMode.startState(); + state.localState = CodeMirror.startState(jsMode); } var token = jsMode.token(stream, state.localState); var text = stream.current(); diff --git a/mode/slim/slim.js b/mode/slim/slim.js index 164464d066..991a97efcd 100644 --- a/mode/slim/slim.js +++ b/mode/slim/slim.js @@ -165,7 +165,7 @@ }; return function(stream, state) { rubyState = state.rubyState; - state.rubyState = rubyMode.startState(); + state.rubyState = CodeMirror.startState(rubyMode); state.tokenize = runSplat; return ruby(stream, state); }; @@ -317,7 +317,7 @@ function startSubMode(mode, state) { var subMode = getMode(mode); - var subState = subMode.startState && subMode.startState(); + var subState = CodeMirror.startState(subMode); state.subMode = subMode; state.subState = subState; @@ -507,8 +507,8 @@ var mode = { // default to html mode startState: function() { - var htmlState = htmlMode.startState(); - var rubyState = rubyMode.startState(); + var htmlState = CodeMirror.startState(htmlMode); + var rubyState = CodeMirror.startState(rubyMode); return { htmlState: htmlState, rubyState: rubyState,