diff --git a/lib/ace/background_tokenizer_test.js b/lib/ace/background_tokenizer_test.js index c62e33f1..7a4cc78c 100644 --- a/lib/ace/background_tokenizer_test.js +++ b/lib/ace/background_tokenizer_test.js @@ -62,19 +62,19 @@ module.exports = { doc.setMode("./mode/javascript") forceTokenize(doc) - testStates(doc, ["comment", "start", "start"]) + testStates(doc, ["comment_regex_allowed", "start", "no_regex"]) doc.remove(new Range(0,2,1,2)) - testStates(doc, [null, "start"]) + testStates(doc, [null, "no_regex"]) forceTokenize(doc) - testStates(doc, ["comment", "comment"]) + testStates(doc, ["comment_regex_allowed", "comment_regex_allowed"]) doc.insert({row:0, column:2}, "\n*/") - testStates(doc, [undefined, undefined, "comment"]) + testStates(doc, [undefined, undefined, "comment_regex_allowed"]) forceTokenize(doc) - testStates(doc, ["comment", "start", "start"]) + testStates(doc, ["comment_regex_allowed", "start", "no_regex"]) } }; diff --git a/lib/ace/mode/javascript.js b/lib/ace/mode/javascript.js index 3b1460a8..866da638 100644 --- a/lib/ace/mode/javascript.js +++ b/lib/ace/mode/javascript.js @@ -91,13 +91,13 @@ oop.inherits(Mode, TextMode); return indent; } - if (state == "start" || state == "regex_allowed") { + if (state == "start" || state == "no_regex") { var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); if (match) { indent += tab; } } else if (state == "doc-start") { - if (endState == "start" || state == "regex_allowed") { + if (endState == "start" || endState == "no_regex") { return ""; } var match = line.match(/^\s*(\/?)\*/); diff --git a/lib/ace/mode/javascript_test.js b/lib/ace/mode/javascript_test.js index 5480b6a8..4937105f 100644 --- a/lib/ace/mode/javascript_test.js +++ b/lib/ace/mode/javascript_test.js @@ -115,7 +115,7 @@ module.exports = { "test: no auto indent should add to existing indent" : function() { assert.equal(" ", this.mode.getNextLineIndent("start", " if () {", " ")); assert.equal(" ", this.mode.getNextLineIndent("start", " cde", " ")); - assert.equal(" ", this.mode.getNextLineIndent("regex_allowed", "function foo(items) {", " ")); + assert.equal(" ", this.mode.getNextLineIndent("start", "function foo(items) {", " ")); }, "test: special indent in doc comments" : function() {