codemirror-rails 0.3.2 → 2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/codemirror/rails/version.rb +2 -2
- data/vendor/assets/javascripts/codemirror.js +501 -525
- data/vendor/assets/javascripts/codemirror/modes/clike.js +3 -1
- data/vendor/assets/javascripts/codemirror/modes/groovy.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/htmlembedded.js +68 -0
- data/vendor/assets/javascripts/codemirror/modes/javascript.js +3 -1
- data/vendor/assets/javascripts/codemirror/modes/markdown.js +4 -4
- data/vendor/assets/javascripts/codemirror/modes/php.js +3 -3
- data/vendor/assets/javascripts/codemirror/modes/python.js +17 -4
- data/vendor/assets/javascripts/codemirror/modes/rst.js +14 -21
- data/vendor/assets/javascripts/codemirror/modes/smalltalk.js +137 -130
- data/vendor/assets/javascripts/codemirror/modes/xml.js +32 -13
- data/vendor/assets/javascripts/codemirror/modes/xmlpure.js +6 -2
- data/vendor/assets/stylesheets/codemirror.css +41 -14
- data/vendor/assets/stylesheets/codemirror/modes/diff.css +3 -3
- data/vendor/assets/stylesheets/codemirror/themes/cobalt.css +1 -0
- data/vendor/assets/stylesheets/codemirror/themes/eclipse.css +3 -2
- data/vendor/assets/stylesheets/codemirror/themes/elegant.css +1 -0
- data/vendor/assets/stylesheets/codemirror/themes/monokai.css +22 -21
- data/vendor/assets/stylesheets/codemirror/themes/neat.css +1 -0
- data/vendor/assets/stylesheets/codemirror/themes/night.css +1 -0
- data/vendor/assets/stylesheets/codemirror/themes/rubyblue.css +1 -0
- metadata +5 -4
@@ -136,7 +136,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
136
136
|
|
137
137
|
indent: function(state, textAfter) {
|
138
138
|
if (state.tokenize != tokenBase && state.tokenize != null) return 0;
|
139
|
-
var
|
139
|
+
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
140
|
+
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
141
|
+
var closing = firstChar == ctx.type;
|
140
142
|
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit);
|
141
143
|
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
142
144
|
else return ctx.indented + (closing ? 0 : indentUnit);
|
@@ -50,7 +50,7 @@ CodeMirror.defineMode("groovy", function(config, parserConfig) {
|
|
50
50
|
return "operator";
|
51
51
|
}
|
52
52
|
stream.eatWhile(/[\w\$_]/);
|
53
|
-
if (ch == "@") return "meta";
|
53
|
+
if (ch == "@") { stream.eatWhile(/[\w\$_\.]/); return "meta"; }
|
54
54
|
if (state.lastToken == ".") return "property";
|
55
55
|
if (stream.eat(":")) { curPunc = "proplabel"; return "property"; }
|
56
56
|
var cur = stream.current();
|
@@ -0,0 +1,68 @@
|
|
1
|
+
CodeMirror.defineMode("htmlembedded", function(config, parserConfig) {
|
2
|
+
|
3
|
+
//config settings
|
4
|
+
var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i,
|
5
|
+
scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i;
|
6
|
+
|
7
|
+
//inner modes
|
8
|
+
var scriptingMode, htmlMixedMode;
|
9
|
+
|
10
|
+
//tokenizer when in html mode
|
11
|
+
function htmlDispatch(stream, state) {
|
12
|
+
if (stream.match(scriptStartRegex, false)) {
|
13
|
+
state.token=scriptingDispatch;
|
14
|
+
return scriptingMode.token(stream, state.scriptState);
|
15
|
+
}
|
16
|
+
else
|
17
|
+
return htmlMixedMode.token(stream, state.htmlState);
|
18
|
+
}
|
19
|
+
|
20
|
+
//tokenizer when in scripting mode
|
21
|
+
function scriptingDispatch(stream, state) {
|
22
|
+
if (stream.match(scriptEndRegex, false)) {
|
23
|
+
state.token=htmlDispatch;
|
24
|
+
return htmlMixedMode.token(stream, state.htmlState);
|
25
|
+
}
|
26
|
+
else
|
27
|
+
return scriptingMode.token(stream, state.scriptState);
|
28
|
+
}
|
29
|
+
|
30
|
+
|
31
|
+
return {
|
32
|
+
startState: function() {
|
33
|
+
scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec);
|
34
|
+
htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed");
|
35
|
+
return {
|
36
|
+
token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch,
|
37
|
+
htmlState : htmlMixedMode.startState(),
|
38
|
+
scriptState : scriptingMode.startState()
|
39
|
+
}
|
40
|
+
},
|
41
|
+
|
42
|
+
token: function(stream, state) {
|
43
|
+
return state.token(stream, state);
|
44
|
+
},
|
45
|
+
|
46
|
+
indent: function(state, textAfter) {
|
47
|
+
if (state.token == htmlDispatch)
|
48
|
+
return htmlMixedMode.indent(state.htmlState, textAfter);
|
49
|
+
else
|
50
|
+
return scriptingMode.indent(state.scriptState, textAfter);
|
51
|
+
},
|
52
|
+
|
53
|
+
copyState: function(state) {
|
54
|
+
return {
|
55
|
+
token : state.token,
|
56
|
+
htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState),
|
57
|
+
scriptState : CodeMirror.copyState(scriptingMode, state.scriptState)
|
58
|
+
}
|
59
|
+
},
|
60
|
+
|
61
|
+
|
62
|
+
electricChars: "/{}:"
|
63
|
+
}
|
64
|
+
});
|
65
|
+
|
66
|
+
CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"});
|
67
|
+
CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"});
|
68
|
+
CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"});
|
@@ -87,7 +87,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
87
87
|
else {
|
88
88
|
stream.eatWhile(/[\w\$_]/);
|
89
89
|
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
|
90
|
-
return known ? ret(known.type, known.style, word) :
|
90
|
+
return (known && state.kwAllowed) ? ret(known.type, known.style, word) :
|
91
91
|
ret("variable", "variable", word);
|
92
92
|
}
|
93
93
|
}
|
@@ -316,6 +316,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
316
316
|
return {
|
317
317
|
tokenize: jsTokenBase,
|
318
318
|
reAllowed: true,
|
319
|
+
kwAllowed: true,
|
319
320
|
cc: [],
|
320
321
|
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
|
321
322
|
localVars: null,
|
@@ -334,6 +335,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
334
335
|
var style = state.tokenize(stream, state);
|
335
336
|
if (type == "comment") return style;
|
336
337
|
state.reAllowed = type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/);
|
338
|
+
state.kwAllowed = type != '.';
|
337
339
|
return parseJS(state, style, type, content, stream);
|
338
340
|
},
|
339
341
|
|
@@ -3,12 +3,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
3
3
|
var htmlMode = CodeMirror.getMode(cmCfg, { name: 'xml', htmlMode: true });
|
4
4
|
|
5
5
|
var header = 'header'
|
6
|
-
, code = '
|
6
|
+
, code = 'comment'
|
7
7
|
, quote = 'quote'
|
8
|
-
, list = '
|
8
|
+
, list = 'string'
|
9
9
|
, hr = 'hr'
|
10
|
-
, linktext = '
|
11
|
-
, linkhref = '
|
10
|
+
, linktext = 'link'
|
11
|
+
, linkhref = 'string'
|
12
12
|
, em = 'em'
|
13
13
|
, strong = 'strong'
|
14
14
|
, emstrong = 'emstrong';
|
@@ -42,9 +42,9 @@
|
|
42
42
|
};
|
43
43
|
|
44
44
|
CodeMirror.defineMode("php", function(config, parserConfig) {
|
45
|
-
var htmlMode = CodeMirror.getMode(config, "
|
46
|
-
var jsMode = CodeMirror.getMode(config, "
|
47
|
-
var cssMode = CodeMirror.getMode(config, "
|
45
|
+
var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true});
|
46
|
+
var jsMode = CodeMirror.getMode(config, "javascript");
|
47
|
+
var cssMode = CodeMirror.getMode(config, "css");
|
48
48
|
var phpMode = CodeMirror.getMode(config, phpConfig);
|
49
49
|
|
50
50
|
function dispatch(stream, state) { // TODO open PHP inside text/css
|
@@ -183,6 +183,10 @@ CodeMirror.defineMode("python", function(conf, parserConf) {
|
|
183
183
|
type = type || 'py';
|
184
184
|
var indentUnit = 0;
|
185
185
|
if (type === 'py') {
|
186
|
+
if (state.scopes[0].type !== 'py') {
|
187
|
+
state.scopes[0].offset = stream.indentation();
|
188
|
+
return;
|
189
|
+
}
|
186
190
|
for (var i = 0; i < state.scopes.length; ++i) {
|
187
191
|
if (state.scopes[i].type === 'py') {
|
188
192
|
indentUnit = state.scopes[i].offset + conf.indentUnit;
|
@@ -198,7 +202,8 @@ CodeMirror.defineMode("python", function(conf, parserConf) {
|
|
198
202
|
});
|
199
203
|
}
|
200
204
|
|
201
|
-
function dedent(stream, state) {
|
205
|
+
function dedent(stream, state, type) {
|
206
|
+
type = type || 'py';
|
202
207
|
if (state.scopes.length == 1) return;
|
203
208
|
if (state.scopes[0].type === 'py') {
|
204
209
|
var _indent = stream.indentation();
|
@@ -217,8 +222,16 @@ CodeMirror.defineMode("python", function(conf, parserConf) {
|
|
217
222
|
}
|
218
223
|
return false
|
219
224
|
} else {
|
220
|
-
|
221
|
-
|
225
|
+
if (type === 'py') {
|
226
|
+
state.scopes[0].offset = stream.indentation();
|
227
|
+
return false;
|
228
|
+
} else {
|
229
|
+
if (state.scopes[0].type != type) {
|
230
|
+
return true;
|
231
|
+
}
|
232
|
+
state.scopes.shift();
|
233
|
+
return false;
|
234
|
+
}
|
222
235
|
}
|
223
236
|
}
|
224
237
|
|
@@ -270,7 +283,7 @@ CodeMirror.defineMode("python", function(conf, parserConf) {
|
|
270
283
|
}
|
271
284
|
delimiter_index = '])}'.indexOf(current);
|
272
285
|
if (delimiter_index !== -1) {
|
273
|
-
if (dedent(stream, state)) {
|
286
|
+
if (dedent(stream, state, current)) {
|
274
287
|
return ERRORCLASS;
|
275
288
|
}
|
276
289
|
}
|
@@ -73,7 +73,7 @@ CodeMirror.defineMode('rst', function(config, options) {
|
|
73
73
|
|
74
74
|
if (i >= 3 && stream.match(/^\s*$/)) {
|
75
75
|
setNormal(state, null);
|
76
|
-
return '
|
76
|
+
return 'header';
|
77
77
|
} else {
|
78
78
|
stream.backUp(i + 1);
|
79
79
|
}
|
@@ -83,8 +83,7 @@ CodeMirror.defineMode('rst', function(config, options) {
|
|
83
83
|
if (!stream.eol()) {
|
84
84
|
setState(state, directive);
|
85
85
|
}
|
86
|
-
|
87
|
-
return 'directive-marker';
|
86
|
+
return 'meta';
|
88
87
|
}
|
89
88
|
|
90
89
|
if (stream.match(reVerbatimMarker)) {
|
@@ -98,14 +97,13 @@ CodeMirror.defineMode('rst', function(config, options) {
|
|
98
97
|
local: mode.startState()
|
99
98
|
});
|
100
99
|
}
|
101
|
-
|
102
|
-
return 'verbatim-marker';
|
100
|
+
return 'meta';
|
103
101
|
}
|
104
102
|
|
105
103
|
if (sol && stream.match(reExamples, false)) {
|
106
104
|
if (!pythonMode) {
|
107
105
|
setState(state, verbatim);
|
108
|
-
return '
|
106
|
+
return 'meta';
|
109
107
|
} else {
|
110
108
|
var mode = pythonMode;
|
111
109
|
|
@@ -118,12 +116,6 @@ CodeMirror.defineMode('rst', function(config, options) {
|
|
118
116
|
}
|
119
117
|
}
|
120
118
|
|
121
|
-
if (sol && (stream.match(reEnumeratedList) ||
|
122
|
-
stream.match(reBulletedList))) {
|
123
|
-
setNormal(state, stream);
|
124
|
-
return 'list';
|
125
|
-
}
|
126
|
-
|
127
119
|
function testBackward(re) {
|
128
120
|
return sol || !state.ctx.back || re.test(state.ctx.back);
|
129
121
|
}
|
@@ -153,9 +145,9 @@ CodeMirror.defineMode('rst', function(config, options) {
|
|
153
145
|
var token;
|
154
146
|
|
155
147
|
if (ch === ':') {
|
156
|
-
token = '
|
148
|
+
token = 'builtin';
|
157
149
|
} else {
|
158
|
-
token = '
|
150
|
+
token = 'atom';
|
159
151
|
}
|
160
152
|
|
161
153
|
setState(state, inline, {
|
@@ -183,9 +175,9 @@ CodeMirror.defineMode('rst', function(config, options) {
|
|
183
175
|
var token;
|
184
176
|
|
185
177
|
if (orig === '*') {
|
186
|
-
token = wide ? 'strong' : '
|
178
|
+
token = wide ? 'strong' : 'em';
|
187
179
|
} else {
|
188
|
-
token = wide ? '
|
180
|
+
token = wide ? 'string' : 'string-2';
|
189
181
|
}
|
190
182
|
|
191
183
|
setState(state, inline, {
|
@@ -247,13 +239,13 @@ CodeMirror.defineMode('rst', function(config, options) {
|
|
247
239
|
var token = null;
|
248
240
|
|
249
241
|
if (stream.match(reDirective)) {
|
250
|
-
token = '
|
242
|
+
token = 'attribute';
|
251
243
|
} else if (stream.match(reHyperlink)) {
|
252
|
-
token = '
|
244
|
+
token = 'link';
|
253
245
|
} else if (stream.match(reFootnote)) {
|
254
|
-
token = '
|
246
|
+
token = 'quote';
|
255
247
|
} else if (stream.match(reCitation)) {
|
256
|
-
token = '
|
248
|
+
token = 'quote';
|
257
249
|
} else {
|
258
250
|
stream.eatSpace();
|
259
251
|
|
@@ -267,6 +259,7 @@ CodeMirror.defineMode('rst', function(config, options) {
|
|
267
259
|
}
|
268
260
|
}
|
269
261
|
|
262
|
+
// FIXME this is unreachable
|
270
263
|
setState(state, body, {start: true});
|
271
264
|
return token;
|
272
265
|
}
|
@@ -290,7 +283,7 @@ CodeMirror.defineMode('rst', function(config, options) {
|
|
290
283
|
|
291
284
|
function verbatim(stream, state) {
|
292
285
|
if (!verbatimMode) {
|
293
|
-
return block(stream, state, '
|
286
|
+
return block(stream, state, 'meta');
|
294
287
|
} else {
|
295
288
|
if (stream.sol()) {
|
296
289
|
if (!stream.eatSpace()) {
|
@@ -1,132 +1,139 @@
|
|
1
|
-
CodeMirror.defineMode(
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
1
|
+
CodeMirror.defineMode('smalltalk', function(config, modeConfig) {
|
2
|
+
|
3
|
+
var specialChars = /[+\-/\\*~<>=@%|&?!.:;^]/;
|
4
|
+
var keywords = /true|false|nil|self|super|thisContext/;
|
5
|
+
|
6
|
+
var Context = function(tokenizer, parent) {
|
7
|
+
this.next = tokenizer;
|
8
|
+
this.parent = parent;
|
9
|
+
};
|
10
|
+
|
11
|
+
var Token = function(name, context, eos) {
|
12
|
+
this.name = name;
|
13
|
+
this.context = context;
|
14
|
+
this.eos = eos;
|
15
|
+
};
|
16
|
+
|
17
|
+
var State = function() {
|
18
|
+
this.context = new Context(next, null);
|
19
|
+
this.expectVariable = true;
|
20
|
+
this.indentation = 0;
|
21
|
+
this.userIndentationDelta = 0;
|
22
|
+
};
|
23
|
+
|
24
|
+
State.prototype.userIndent = function(indentation) {
|
25
|
+
this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0;
|
26
|
+
};
|
27
|
+
|
28
|
+
var next = function(stream, context, state) {
|
29
|
+
var token = new Token(null, context, false);
|
30
|
+
var char = stream.next();
|
31
|
+
|
32
|
+
if (char === '"') {
|
33
|
+
token = nextComment(stream, new Context(nextComment, context));
|
34
|
+
|
35
|
+
} else if (char === '\'') {
|
36
|
+
token = nextString(stream, new Context(nextString, context));
|
37
|
+
|
38
|
+
} else if (char === '#') {
|
39
|
+
stream.eatWhile(/[^ .]/);
|
40
|
+
token.name = 'string-2';
|
41
|
+
|
42
|
+
} else if (char === '$') {
|
43
|
+
stream.eatWhile(/[^ ]/);
|
44
|
+
token.name = 'string-2';
|
45
|
+
|
46
|
+
} else if (char === '|' && state.expectVariable) {
|
47
|
+
token.context = new Context(nextTemporaries, context);
|
48
|
+
|
49
|
+
} else if (/[\[\]{}()]/.test(char)) {
|
50
|
+
token.name = 'bracket';
|
51
|
+
token.eos = /[\[{(]/.test(char);
|
52
|
+
|
53
|
+
if (char === '[') {
|
54
|
+
state.indentation++;
|
55
|
+
} else if (char === ']') {
|
56
|
+
state.indentation = Math.max(0, state.indentation - 1);
|
57
|
+
}
|
58
|
+
|
59
|
+
} else if (specialChars.test(char)) {
|
60
|
+
stream.eatWhile(specialChars);
|
61
|
+
token.name = 'operator';
|
62
|
+
token.eos = char !== ';'; // ; cascaded message expression
|
63
|
+
|
64
|
+
} else if (/\d/.test(char)) {
|
65
|
+
stream.eatWhile(/[\w\d]/);
|
66
|
+
token.name = 'number'
|
67
|
+
|
68
|
+
} else if (/[\w_]/.test(char)) {
|
69
|
+
stream.eatWhile(/[\w\d_]/);
|
70
|
+
token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null;
|
71
|
+
|
72
|
+
} else {
|
73
|
+
token.eos = state.expectVariable;
|
74
|
+
}
|
75
|
+
|
76
|
+
return token;
|
77
|
+
};
|
78
|
+
|
79
|
+
var nextComment = function(stream, context) {
|
80
|
+
stream.eatWhile(/[^"]/);
|
81
|
+
return new Token('comment', stream.eat('"') ? context.parent : context, true);
|
82
|
+
};
|
83
|
+
|
84
|
+
var nextString = function(stream, context) {
|
85
|
+
stream.eatWhile(/[^']/);
|
86
|
+
return new Token('string', stream.eat('\'') ? context.parent : context, false);
|
87
|
+
};
|
88
|
+
|
89
|
+
var nextTemporaries = function(stream, context, state) {
|
90
|
+
var token = new Token(null, context, false);
|
91
|
+
var char = stream.next();
|
92
|
+
|
93
|
+
if (char === '|') {
|
94
|
+
token.context = context.parent;
|
95
|
+
token.eos = true;
|
96
|
+
|
97
|
+
} else {
|
98
|
+
stream.eatWhile(/[^|]/);
|
99
|
+
token.name = 'variable';
|
100
|
+
}
|
101
|
+
|
102
|
+
return token;
|
103
|
+
}
|
104
|
+
|
105
|
+
return {
|
106
|
+
startState: function() {
|
107
|
+
return new State;
|
108
|
+
},
|
109
|
+
|
110
|
+
token: function(stream, state) {
|
111
|
+
state.userIndent(stream.indentation());
|
112
|
+
|
113
|
+
if (stream.eatSpace()) {
|
114
|
+
return null;
|
115
|
+
}
|
116
|
+
|
117
|
+
var token = state.context.next(stream, state.context, state);
|
118
|
+
state.context = token.context;
|
119
|
+
state.expectVariable = token.eos;
|
120
|
+
|
121
|
+
state.lastToken = token;
|
122
|
+
return token.name;
|
123
|
+
},
|
124
|
+
|
125
|
+
blankLine: function(state) {
|
126
|
+
state.userIndent(0);
|
127
|
+
},
|
128
|
+
|
129
|
+
indent: function(state, textAfter) {
|
130
|
+
var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta;
|
131
|
+
return (state.indentation + i) * config.indentUnit;
|
132
|
+
},
|
133
|
+
|
134
|
+
electricChars: ']'
|
135
|
+
};
|
136
|
+
|
130
137
|
});
|
131
138
|
|
132
|
-
CodeMirror.defineMIME(
|
139
|
+
CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'});
|