codemirror-rails 5.0 → 5.1
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.
- checksums.yaml +4 -4
- data/lib/codemirror/rails/version.rb +2 -2
- data/vendor/assets/javascripts/codemirror.js +104 -64
- data/vendor/assets/javascripts/codemirror/addons/dialog/dialog.js +3 -1
- data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +144 -121
- data/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js +4 -2
- data/vendor/assets/javascripts/codemirror/addons/hint/css-hint.js +4 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js +13 -8
- data/vendor/assets/javascripts/codemirror/addons/lint/lint.js +2 -0
- data/vendor/assets/javascripts/codemirror/addons/merge/merge.js +40 -0
- data/vendor/assets/javascripts/codemirror/addons/mode/multiplex_test.js +33 -0
- data/vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.js +8 -2
- data/vendor/assets/javascripts/codemirror/addons/tern/tern.js +1 -1
- data/vendor/assets/javascripts/codemirror/keymaps/sublime.js +13 -0
- data/vendor/assets/javascripts/codemirror/keymaps/vim.js +43 -54
- data/vendor/assets/javascripts/codemirror/modes/asciiarmor.js +73 -0
- data/vendor/assets/javascripts/codemirror/modes/clike.js +2 -1
- data/vendor/assets/javascripts/codemirror/modes/clojure.js +1 -0
- data/vendor/assets/javascripts/codemirror/modes/cmake.js +97 -0
- data/vendor/assets/javascripts/codemirror/modes/commonlisp.js +1 -0
- data/vendor/assets/javascripts/codemirror/modes/css.js +1 -0
- data/vendor/assets/javascripts/codemirror/modes/groovy.js +1 -0
- data/vendor/assets/javascripts/codemirror/modes/htmlembedded.js +18 -76
- data/vendor/assets/javascripts/codemirror/modes/javascript.js +5 -0
- data/vendor/assets/javascripts/codemirror/modes/kotlin.js +1 -0
- data/vendor/assets/javascripts/codemirror/modes/less_test.js +51 -0
- data/vendor/assets/javascripts/codemirror/modes/mllike.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/properties.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/python.js +1 -0
- data/vendor/assets/javascripts/codemirror/modes/sass.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/scheme.js +1 -0
- data/vendor/assets/javascripts/codemirror/modes/scss_test.js +110 -0
- data/vendor/assets/javascripts/codemirror/modes/smarty.js +100 -107
- data/vendor/assets/javascripts/codemirror/modes/stylus.js +651 -332
- data/vendor/assets/javascripts/codemirror/modes/test.js +67 -0
- data/vendor/assets/javascripts/codemirror/modes/troff.js +82 -0
- data/vendor/assets/javascripts/codemirror/modes/vb.js +6 -5
- data/vendor/assets/javascripts/codemirror/modes/verilog.js +53 -53
- data/vendor/assets/stylesheets/codemirror.css +11 -8
- data/vendor/assets/stylesheets/codemirror/themes/mdn-like.css +1 -1
- metadata +9 -3
- data/vendor/assets/javascripts/codemirror/modes/smartymixed.js +0 -197
@@ -0,0 +1,67 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
// Don't take these too seriously -- the expected results appear to be
|
5
|
+
// based on the results of actual runs without any serious manual
|
6
|
+
// verification. If a change you made causes them to fail, the test is
|
7
|
+
// as likely to wrong as the code.
|
8
|
+
|
9
|
+
(function() {
|
10
|
+
var mode = CodeMirror.getMode({tabSize: 4}, "xquery");
|
11
|
+
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
|
12
|
+
|
13
|
+
MT("eviltest",
|
14
|
+
"[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a \"comment\" :)]",
|
15
|
+
" [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]",
|
16
|
+
" [keyword let] [variable $joe][keyword :=][atom 1]",
|
17
|
+
" [keyword return] [keyword element] [variable element] {",
|
18
|
+
" [keyword attribute] [variable attribute] { [atom 1] },",
|
19
|
+
" [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },",
|
20
|
+
" [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],",
|
21
|
+
" [keyword //][variable x] } [comment (: a more 'evil' test :)]",
|
22
|
+
" [comment (: Modified Blakeley example (: with nested comment :) ... :)]",
|
23
|
+
" [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]",
|
24
|
+
" [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]",
|
25
|
+
" [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]",
|
26
|
+
" [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]",
|
27
|
+
" [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]",
|
28
|
+
" [keyword return] [keyword element] [variable element] {",
|
29
|
+
" [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },",
|
30
|
+
" [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },",
|
31
|
+
" [keyword element] [variable text] { [keyword text] { [variable "text"] } },",
|
32
|
+
" [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],",
|
33
|
+
" [keyword //][variable fn:doc]",
|
34
|
+
" }");
|
35
|
+
|
36
|
+
MT("testEmptySequenceKeyword",
|
37
|
+
"[string \"foo\"] [keyword instance] [keyword of] [keyword empty-sequence]()");
|
38
|
+
|
39
|
+
MT("testMultiAttr",
|
40
|
+
"[tag <p ][attribute a1]=[string \"foo\"] [attribute a2]=[string \"bar\"][tag >][variable hello] [variable world][tag </p>]");
|
41
|
+
|
42
|
+
MT("test namespaced variable",
|
43
|
+
"[keyword declare] [keyword namespace] [variable e] [keyword =] [string \"http://example.com/ANamespace\"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]");
|
44
|
+
|
45
|
+
MT("test EQName variable",
|
46
|
+
"[keyword declare] [keyword variable] [variable $\"http://www.example.com/ns/my\":var] [keyword :=] [atom 12][variable ;]",
|
47
|
+
"[tag <out>]{[variable $\"http://www.example.com/ns/my\":var]}[tag </out>]");
|
48
|
+
|
49
|
+
MT("test EQName function",
|
50
|
+
"[keyword declare] [keyword function] [def&variable \"http://www.example.com/ns/my\":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {",
|
51
|
+
" [variable $a] [keyword +] [atom 2]",
|
52
|
+
"}[variable ;]",
|
53
|
+
"[tag <out>]{[def&variable \"http://www.example.com/ns/my\":fn]([atom 12])}[tag </out>]");
|
54
|
+
|
55
|
+
MT("test EQName function with single quotes",
|
56
|
+
"[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {",
|
57
|
+
" [variable $a] [keyword +] [atom 2]",
|
58
|
+
"}[variable ;]",
|
59
|
+
"[tag <out>]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag </out>]");
|
60
|
+
|
61
|
+
MT("testProcessingInstructions",
|
62
|
+
"[def&variable data]([comment&meta <?target content?>]) [keyword instance] [keyword of] [atom xs:string]");
|
63
|
+
|
64
|
+
MT("testQuoteEscapeDouble",
|
65
|
+
"[keyword let] [variable $rootfolder] [keyword :=] [string \"c:\\builds\\winnt\\HEAD\\qa\\scripts\\\"]",
|
66
|
+
"[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string \"keys\\\"])");
|
67
|
+
})();
|
@@ -0,0 +1,82 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object")
|
6
|
+
mod(require("../../lib/codemirror"));
|
7
|
+
else if (typeof define == "function" && define.amd)
|
8
|
+
define(["../../lib/codemirror"], mod);
|
9
|
+
else
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
CodeMirror.defineMode('troff', function() {
|
15
|
+
|
16
|
+
var words = {};
|
17
|
+
|
18
|
+
function tokenBase(stream) {
|
19
|
+
if (stream.eatSpace()) return null;
|
20
|
+
|
21
|
+
var sol = stream.sol();
|
22
|
+
var ch = stream.next();
|
23
|
+
|
24
|
+
if (ch === '\\') {
|
25
|
+
if (stream.match('fB') || stream.match('fR') || stream.match('fI') ||
|
26
|
+
stream.match('u') || stream.match('d') ||
|
27
|
+
stream.match('%') || stream.match('&')) {
|
28
|
+
return 'string';
|
29
|
+
}
|
30
|
+
if (stream.match('m[')) {
|
31
|
+
stream.skipTo(']');
|
32
|
+
stream.next();
|
33
|
+
return 'string';
|
34
|
+
}
|
35
|
+
if (stream.match('s+') || stream.match('s-')) {
|
36
|
+
stream.eatWhile(/[\d-]/);
|
37
|
+
return 'string';
|
38
|
+
}
|
39
|
+
if (stream.match('\(') || stream.match('*\(')) {
|
40
|
+
stream.eatWhile(/[\w-]/);
|
41
|
+
return 'string';
|
42
|
+
}
|
43
|
+
return 'string';
|
44
|
+
}
|
45
|
+
if (sol && (ch === '.' || ch === '\'')) {
|
46
|
+
if (stream.eat('\\') && stream.eat('\"')) {
|
47
|
+
stream.skipToEnd();
|
48
|
+
return 'comment';
|
49
|
+
}
|
50
|
+
}
|
51
|
+
if (sol && ch === '.') {
|
52
|
+
if (stream.match('B ') || stream.match('I ') || stream.match('R ')) {
|
53
|
+
return 'attribute';
|
54
|
+
}
|
55
|
+
if (stream.match('TH ') || stream.match('SH ') || stream.match('SS ') || stream.match('HP ')) {
|
56
|
+
stream.skipToEnd();
|
57
|
+
return 'quote';
|
58
|
+
}
|
59
|
+
if ((stream.match(/[A-Z]/) && stream.match(/[A-Z]/)) || (stream.match(/[a-z]/) && stream.match(/[a-z]/))) {
|
60
|
+
return 'attribute';
|
61
|
+
}
|
62
|
+
}
|
63
|
+
stream.eatWhile(/[\w-]/);
|
64
|
+
var cur = stream.current();
|
65
|
+
return words.hasOwnProperty(cur) ? words[cur] : null;
|
66
|
+
}
|
67
|
+
|
68
|
+
function tokenize(stream, state) {
|
69
|
+
return (state.tokens[0] || tokenBase) (stream, state);
|
70
|
+
};
|
71
|
+
|
72
|
+
return {
|
73
|
+
startState: function() {return {tokens:[]};},
|
74
|
+
token: function(stream, state) {
|
75
|
+
return tokenize(stream, state);
|
76
|
+
}
|
77
|
+
};
|
78
|
+
});
|
79
|
+
|
80
|
+
CodeMirror.defineMIME('troff', 'troff');
|
81
|
+
|
82
|
+
});
|
@@ -29,13 +29,14 @@ CodeMirror.defineMode("vb", function(conf, parserConf) {
|
|
29
29
|
var middleKeywords = ['else','elseif','case', 'catch'];
|
30
30
|
var endKeywords = ['next','loop'];
|
31
31
|
|
32
|
-
var
|
33
|
-
var
|
32
|
+
var operatorKeywords = ['and', 'or', 'not', 'xor', 'in'];
|
33
|
+
var wordOperators = wordRegexp(operatorKeywords);
|
34
|
+
var commonKeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until',
|
34
35
|
'goto', 'byval','byref','new','handles','property', 'return',
|
35
36
|
'const','private', 'protected', 'friend', 'public', 'shared', 'static', 'true','false'];
|
36
37
|
var commontypes = ['integer','string','double','decimal','boolean','short','char', 'float','single'];
|
37
38
|
|
38
|
-
var keywords = wordRegexp(
|
39
|
+
var keywords = wordRegexp(commonKeywords);
|
39
40
|
var types = wordRegexp(commontypes);
|
40
41
|
var stringPrefixes = '"';
|
41
42
|
|
@@ -47,8 +48,8 @@ CodeMirror.defineMode("vb", function(conf, parserConf) {
|
|
47
48
|
|
48
49
|
var indentInfo = null;
|
49
50
|
|
50
|
-
|
51
|
-
|
51
|
+
CodeMirror.registerHelper("hintWords", "vb", openingKeywords.concat(middleKeywords).concat(endKeywords)
|
52
|
+
.concat(operatorKeywords).concat(commonKeywords).concat(commontypes));
|
52
53
|
|
53
54
|
function indent(_stream, state) {
|
54
55
|
state.currentIndent++;
|
@@ -375,73 +375,73 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
|
|
375
375
|
name: "verilog"
|
376
376
|
});
|
377
377
|
|
378
|
-
//
|
378
|
+
// TLVVerilog mode
|
379
379
|
|
380
|
-
var
|
380
|
+
var tlvchScopePrefixes = {
|
381
381
|
">": "property", "->": "property", "-": "hr", "|": "link", "?$": "qualifier", "?*": "qualifier",
|
382
382
|
"@-": "variable-3", "@": "variable-3", "?": "qualifier"
|
383
383
|
};
|
384
384
|
|
385
|
-
function
|
386
|
-
var
|
385
|
+
function tlvGenIndent(stream, state) {
|
386
|
+
var tlvindentUnit = 2;
|
387
387
|
var rtnIndent = -1, indentUnitRq = 0, curIndent = stream.indentation();
|
388
|
-
switch (state.
|
388
|
+
switch (state.tlvCurCtlFlowChar) {
|
389
389
|
case "\\":
|
390
390
|
curIndent = 0;
|
391
391
|
break;
|
392
392
|
case "|":
|
393
|
-
if (state.
|
393
|
+
if (state.tlvPrevPrevCtlFlowChar == "@") {
|
394
394
|
indentUnitRq = -2; //-2 new pipe rq after cur pipe
|
395
395
|
break;
|
396
396
|
}
|
397
|
-
if (
|
397
|
+
if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar])
|
398
398
|
indentUnitRq = 1; // +1 new scope
|
399
399
|
break;
|
400
400
|
case "M": // m4
|
401
|
-
if (state.
|
401
|
+
if (state.tlvPrevPrevCtlFlowChar == "@") {
|
402
402
|
indentUnitRq = -2; //-2 new inst rq after pipe
|
403
403
|
break;
|
404
404
|
}
|
405
|
-
if (
|
405
|
+
if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar])
|
406
406
|
indentUnitRq = 1; // +1 new scope
|
407
407
|
break;
|
408
408
|
case "@":
|
409
|
-
if (state.
|
409
|
+
if (state.tlvPrevCtlFlowChar == "S")
|
410
410
|
indentUnitRq = -1; // new pipe stage after stmts
|
411
|
-
if (state.
|
411
|
+
if (state.tlvPrevCtlFlowChar == "|")
|
412
412
|
indentUnitRq = 1; // 1st pipe stage
|
413
413
|
break;
|
414
414
|
case "S":
|
415
|
-
if (state.
|
415
|
+
if (state.tlvPrevCtlFlowChar == "@")
|
416
416
|
indentUnitRq = 1; // flow in pipe stage
|
417
|
-
if (
|
417
|
+
if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar])
|
418
418
|
indentUnitRq = 1; // +1 new scope
|
419
419
|
break;
|
420
420
|
}
|
421
|
-
var statementIndentUnit =
|
421
|
+
var statementIndentUnit = tlvindentUnit;
|
422
422
|
rtnIndent = curIndent + (indentUnitRq*statementIndentUnit);
|
423
423
|
return rtnIndent >= 0 ? rtnIndent : curIndent;
|
424
424
|
}
|
425
425
|
|
426
|
-
CodeMirror.defineMIME("text/x-
|
426
|
+
CodeMirror.defineMIME("text/x-tlv", {
|
427
427
|
name: "verilog",
|
428
428
|
hooks: {
|
429
429
|
"\\": function(stream, state) {
|
430
430
|
var vxIndent = 0, style = false;
|
431
431
|
var curPunc = stream.string;
|
432
|
-
if ((stream.sol()) && (/\\SV/.test(stream.string))) {
|
433
|
-
curPunc = (/\\
|
434
|
-
? "\\
|
432
|
+
if ((stream.sol()) && ((/\\SV/.test(stream.string)) || (/\\TLV/.test(stream.string)))) {
|
433
|
+
curPunc = (/\\TLV_version/.test(stream.string))
|
434
|
+
? "\\TLV_version" : stream.string;
|
435
435
|
stream.skipToEnd();
|
436
436
|
if (curPunc == "\\SV" && state.vxCodeActive) {state.vxCodeActive = false;};
|
437
|
-
if ((/\\
|
438
|
-
|| (curPunc=="\\
|
437
|
+
if ((/\\TLV/.test(curPunc) && !state.vxCodeActive)
|
438
|
+
|| (curPunc=="\\TLV_version" && state.vxCodeActive)) {state.vxCodeActive = true;};
|
439
439
|
style = "keyword";
|
440
|
-
state.
|
441
|
-
= state.
|
440
|
+
state.tlvCurCtlFlowChar = state.tlvPrevPrevCtlFlowChar
|
441
|
+
= state.tlvPrevCtlFlowChar = "";
|
442
442
|
if (state.vxCodeActive == true) {
|
443
|
-
state.
|
444
|
-
vxIndent =
|
443
|
+
state.tlvCurCtlFlowChar = "\\";
|
444
|
+
vxIndent = tlvGenIndent(stream, state);
|
445
445
|
}
|
446
446
|
state.vxIndentRq = vxIndent;
|
447
447
|
}
|
@@ -449,12 +449,12 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
|
|
449
449
|
},
|
450
450
|
tokenBase: function(stream, state) {
|
451
451
|
var vxIndent = 0, style = false;
|
452
|
-
var
|
453
|
-
var
|
452
|
+
var tlvisOperatorChar = /[\[\]=:]/;
|
453
|
+
var tlvkpScopePrefixs = {
|
454
454
|
"**":"variable-2", "*":"variable-2", "$$":"variable", "$":"variable",
|
455
455
|
"^^":"attribute", "^":"attribute"};
|
456
456
|
var ch = stream.peek();
|
457
|
-
var vxCurCtlFlowCharValueAtStart = state.
|
457
|
+
var vxCurCtlFlowCharValueAtStart = state.tlvCurCtlFlowChar;
|
458
458
|
if (state.vxCodeActive == true) {
|
459
459
|
if (/[\[\]{}\(\);\:]/.test(ch)) {
|
460
460
|
// bypass nesting and 1 char punc
|
@@ -465,70 +465,70 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
|
|
465
465
|
if (stream.eat("/")) {
|
466
466
|
stream.skipToEnd();
|
467
467
|
style = "comment";
|
468
|
-
state.
|
468
|
+
state.tlvCurCtlFlowChar = "S";
|
469
469
|
} else {
|
470
470
|
stream.backUp(1);
|
471
471
|
}
|
472
472
|
} else if (ch == "@") {
|
473
473
|
// pipeline stage
|
474
|
-
style =
|
475
|
-
state.
|
474
|
+
style = tlvchScopePrefixes[ch];
|
475
|
+
state.tlvCurCtlFlowChar = "@";
|
476
476
|
stream.next();
|
477
477
|
stream.eatWhile(/[\w\$_]/);
|
478
478
|
} else if (stream.match(/\b[mM]4+/, true)) { // match: function(pattern, consume, caseInsensitive)
|
479
479
|
// m4 pre proc
|
480
480
|
stream.skipTo("(");
|
481
481
|
style = "def";
|
482
|
-
state.
|
482
|
+
state.tlvCurCtlFlowChar = "M";
|
483
483
|
} else if (ch == "!" && stream.sol()) {
|
484
|
-
// v stmt in
|
485
|
-
// state.
|
484
|
+
// v stmt in tlv region
|
485
|
+
// state.tlvCurCtlFlowChar = "S";
|
486
486
|
style = "comment";
|
487
487
|
stream.next();
|
488
|
-
} else if (
|
488
|
+
} else if (tlvisOperatorChar.test(ch)) {
|
489
489
|
// operators
|
490
|
-
stream.eatWhile(
|
490
|
+
stream.eatWhile(tlvisOperatorChar);
|
491
491
|
style = "operator";
|
492
492
|
} else if (ch == "#") {
|
493
493
|
// phy hier
|
494
|
-
state.
|
495
|
-
? ch : state.
|
494
|
+
state.tlvCurCtlFlowChar = (state.tlvCurCtlFlowChar == "")
|
495
|
+
? ch : state.tlvCurCtlFlowChar;
|
496
496
|
stream.next();
|
497
497
|
stream.eatWhile(/[+-]\d/);
|
498
498
|
style = "tag";
|
499
|
-
} else if (
|
500
|
-
// special
|
501
|
-
style =
|
502
|
-
state.
|
499
|
+
} else if (tlvkpScopePrefixs.propertyIsEnumerable(ch)) {
|
500
|
+
// special TLV operators
|
501
|
+
style = tlvkpScopePrefixs[ch];
|
502
|
+
state.tlvCurCtlFlowChar = state.tlvCurCtlFlowChar == "" ? "S" : state.tlvCurCtlFlowChar; // stmt
|
503
503
|
stream.next();
|
504
504
|
stream.match(/[a-zA-Z_0-9]+/);
|
505
|
-
} else if (style =
|
506
|
-
// special
|
507
|
-
state.
|
505
|
+
} else if (style = tlvchScopePrefixes[ch] || false) {
|
506
|
+
// special TLV operators
|
507
|
+
state.tlvCurCtlFlowChar = state.tlvCurCtlFlowChar == "" ? ch : state.tlvCurCtlFlowChar;
|
508
508
|
stream.next();
|
509
509
|
stream.match(/[a-zA-Z_0-9]+/);
|
510
510
|
}
|
511
|
-
if (state.
|
512
|
-
vxIndent =
|
511
|
+
if (state.tlvCurCtlFlowChar != vxCurCtlFlowCharValueAtStart) { // flow change
|
512
|
+
vxIndent = tlvGenIndent(stream, state);
|
513
513
|
state.vxIndentRq = vxIndent;
|
514
514
|
}
|
515
515
|
}
|
516
516
|
return style;
|
517
517
|
},
|
518
518
|
token: function(stream, state) {
|
519
|
-
if (state.vxCodeActive == true && stream.sol() && state.
|
520
|
-
state.
|
521
|
-
state.
|
522
|
-
state.
|
519
|
+
if (state.vxCodeActive == true && stream.sol() && state.tlvCurCtlFlowChar != "") {
|
520
|
+
state.tlvPrevPrevCtlFlowChar = state.tlvPrevCtlFlowChar;
|
521
|
+
state.tlvPrevCtlFlowChar = state.tlvCurCtlFlowChar;
|
522
|
+
state.tlvCurCtlFlowChar = "";
|
523
523
|
}
|
524
524
|
},
|
525
525
|
indent: function(state) {
|
526
526
|
return (state.vxCodeActive == true) ? state.vxIndentRq : -1;
|
527
527
|
},
|
528
528
|
startState: function(state) {
|
529
|
-
state.
|
530
|
-
state.
|
531
|
-
state.
|
529
|
+
state.tlvCurCtlFlowChar = "";
|
530
|
+
state.tlvPrevCtlFlowChar = "";
|
531
|
+
state.tlvPrevPrevCtlFlowChar = "";
|
532
532
|
state.vxCodeActive = true;
|
533
533
|
state.vxIndentRq = 0;
|
534
534
|
}
|
@@ -33,8 +33,7 @@
|
|
33
33
|
min-width: 20px;
|
34
34
|
text-align: right;
|
35
35
|
color: #999;
|
36
|
-
-
|
37
|
-
box-sizing: content-box;
|
36
|
+
white-space: nowrap;
|
38
37
|
}
|
39
38
|
|
40
39
|
.CodeMirror-guttermarker { color: black; }
|
@@ -154,14 +153,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
154
153
|
height: 100%;
|
155
154
|
outline: none; /* Prevent dragging from highlighting the element */
|
156
155
|
position: relative;
|
157
|
-
-moz-box-sizing: content-box;
|
158
|
-
box-sizing: content-box;
|
159
156
|
}
|
160
157
|
.CodeMirror-sizer {
|
161
158
|
position: relative;
|
162
159
|
border-right: 30px solid transparent;
|
163
|
-
-moz-box-sizing: content-box;
|
164
|
-
box-sizing: content-box;
|
165
160
|
}
|
166
161
|
|
167
162
|
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
@@ -196,8 +191,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
196
191
|
.CodeMirror-gutter {
|
197
192
|
white-space: normal;
|
198
193
|
height: 100%;
|
199
|
-
-moz-box-sizing: content-box;
|
200
|
-
box-sizing: content-box;
|
201
194
|
display: inline-block;
|
202
195
|
margin-bottom: -30px;
|
203
196
|
/* Hack to make IE7 behave */
|
@@ -265,6 +258,16 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
265
258
|
outline: none;
|
266
259
|
}
|
267
260
|
|
261
|
+
/* Force content-box sizing for the elements where we expect it */
|
262
|
+
.CodeMirror-scroll,
|
263
|
+
.CodeMirror-sizer,
|
264
|
+
.CodeMirror-gutter,
|
265
|
+
.CodeMirror-gutters,
|
266
|
+
.CodeMirror-linenumber {
|
267
|
+
-moz-box-sizing: content-box;
|
268
|
+
box-sizing: content-box;
|
269
|
+
}
|
270
|
+
|
268
271
|
.CodeMirror-measure {
|
269
272
|
position: absolute;
|
270
273
|
width: 100%;
|
@@ -13,7 +13,7 @@
|
|
13
13
|
.cm-s-mdn-like.CodeMirror ::-moz-selection { background: #cfc; }
|
14
14
|
|
15
15
|
.cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; }
|
16
|
-
.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa;
|
16
|
+
.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; padding-left: 8px; }
|
17
17
|
div.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; }
|
18
18
|
|
19
19
|
.cm-s-mdn-like .cm-keyword { color: #6262FF; }
|