vendor/assets/javascripts/codemirror/modes/stex.js in codemirror-rails-4.8 vs vendor/assets/javascripts/codemirror/modes/stex.js in codemirror-rails-4.9
- old
+ new
@@ -128,12 +128,11 @@
var ch = source.next();
if (ch == "%") {
source.skipToEnd();
return "comment";
- }
- else if (ch == '}' || ch == ']') {
+ } else if (ch == '}' || ch == ']') {
plug = peekCommand(state);
if (plug) {
plug.closeBracket(ch);
setState(state, beginParams);
} else {
@@ -143,16 +142,14 @@
} else if (ch == '{' || ch == '[') {
plug = plugins["DEFAULT"];
plug = new plug();
pushCommand(state, plug);
return "bracket";
- }
- else if (/\d/.test(ch)) {
+ } else if (/\d/.test(ch)) {
source.eatWhile(/[\w.%]/);
return "atom";
- }
- else {
+ } else {
source.eatWhile(/[\w\-_]/);
plug = getMostPowerful(state);
if (plug.name == 'begin') {
plug.argument = source.current();
}
@@ -240,9 +237,10 @@
token: function(stream, state) {
return state.f(stream, state);
},
blankLine: function(state) {
state.f = normal;
+ state.cmdState.length = 0;
},
lineComment: "%"
};
});