Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: Source/devtools/front_end/cm/headlesscodemirror.js

Issue 354833004: DevTools: [CodeMirror] roll CodeMirror to version @e20d175 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/cm/css.js ('k') | Source/devtools/front_end/cm/htmlembedded.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Content of the function is equal to runmode-standalone.js file 1 // Content of the function is equal to runmode-standalone.js file
2 // from CodeMirror distribution 2 // from CodeMirror distribution
3 (function(window) { 3 (function(window) {
4 // CodeMirror, copyright (c) by Marijn Haverbeke and others
5 // Distributed under an MIT license: http://codemirror.net/LICENSE
6
4 window.CodeMirror = {}; 7 window.CodeMirror = {};
5 8
6 (function() { 9 (function() {
7 "use strict"; 10 "use strict";
8 11
9 function splitLines(string){ return string.split(/\r?\n|\r/); }; 12 function splitLines(string){ return string.split(/\r?\n|\r/); };
10 13
11 function StringStream(string) { 14 function StringStream(string) {
12 this.pos = this.start = 0; 15 this.pos = this.start = 0;
13 this.string = string; 16 this.string = string;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } else { 138 } else {
136 node.appendChild(document.createTextNode(content)); 139 node.appendChild(document.createTextNode(content));
137 } 140 }
138 }; 141 };
139 } 142 }
140 143
141 var lines = splitLines(string), state = (options && options.state) || CodeMirr or.startState(mode); 144 var lines = splitLines(string), state = (options && options.state) || CodeMirr or.startState(mode);
142 for (var i = 0, e = lines.length; i < e; ++i) { 145 for (var i = 0, e = lines.length; i < e; ++i) {
143 if (i) callback("\n"); 146 if (i) callback("\n");
144 var stream = new CodeMirror.StringStream(lines[i]); 147 var stream = new CodeMirror.StringStream(lines[i]);
148 if (!stream.string && mode.blankLine) mode.blankLine(state);
145 while (!stream.eol()) { 149 while (!stream.eol()) {
146 var style = mode.token(stream, state); 150 var style = mode.token(stream, state);
147 callback(stream.current(), style, i, stream.start, state); 151 callback(stream.current(), style, i, stream.start, state);
148 stream.start = stream.pos; 152 stream.start = stream.pos;
149 } 153 }
150 } 154 }
151 }; 155 };
152 })(); 156 })();
153
154 }(this)) 157 }(this))
OLDNEW
« no previous file with comments | « Source/devtools/front_end/cm/css.js ('k') | Source/devtools/front_end/cm/htmlembedded.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698