Changeset 3758:6338fb89e8df for admin/js/codemirror/addon
- Timestamp:
- 06/13/18 12:31:58 (7 years ago)
- Branch:
- default
- Location:
- admin/js/codemirror/addon
- Files:
-
- 3 edited
-
edit/closebrackets.js (modified) (1 diff)
-
edit/matchbrackets.js (modified) (2 diffs)
-
mode/multiplex.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
admin/js/codemirror/addon/edit/closebrackets.js
r3617 r3758 130 130 curType = "skip"; 131 131 } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && 132 cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch &&133 (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {132 cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) { 133 if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass; 134 134 curType = "addFour"; 135 135 } else if (identical) { -
admin/js/codemirror/addon/edit/matchbrackets.js
r3617 r3758 103 103 } 104 104 105 var currentlyHighlighted = null;106 105 function doMatchBrackets(cm) { 107 106 cm.operation(function() { 108 if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} 109 currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); 107 if (cm.state.matchBrackets.currentlyHighlighted) { 108 cm.state.matchBrackets.currentlyHighlighted(); 109 cm.state.matchBrackets.currentlyHighlighted = null; 110 } 111 cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); 110 112 }); 111 113 } … … 114 116 if (old && old != CodeMirror.Init) { 115 117 cm.off("cursorActivity", doMatchBrackets); 116 if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} 118 if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) { 119 cm.state.matchBrackets.currentlyHighlighted(); 120 cm.state.matchBrackets.currentlyHighlighted = null; 121 } 117 122 } 118 123 if (val) { -
admin/js/codemirror/addon/mode/multiplex.js
r3251 r3758 51 51 if (!other.parseDelimiters) stream.match(other.open); 52 52 state.innerActive = other; 53 state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); 53 54 // Get the outer indent, making sure to handle CodeMirror.Pass 55 var outerIndent = 0; 56 if (outer.indent) { 57 var possibleOuterIndent = outer.indent(state.outer, ""); 58 if (possibleOuterIndent !== CodeMirror.Pass) outerIndent = possibleOuterIndent; 59 } 60 61 state.inner = CodeMirror.startState(other.mode, outerIndent); 54 62 return other.delimStyle && (other.delimStyle + " " + other.delimStyle + "-open"); 55 63 } else if (found != -1 && found < cutOff) {
Note: See TracChangeset
for help on using the changeset viewer.
