MCPcopy Index your code
hub / github.com/csev/py4e / lineLength

Function lineLength

tools/pythonauto/static/codemirror/codemirror.js:284–300  ·  view source on GitHub ↗
(doc, line)

Source from the content-addressed store, hash-verified

282 }
283
284 function lineLength(doc, line) {
285 if (line.height == 0) return 0;
286 var len = line.text.length, merged, cur = line;
287 while (merged = collapsedSpanAtStart(cur)) {
288 var found = merged.find();
289 cur = getLine(doc, found.from.line);
290 len += found.from.ch - found.to.ch;
291 }
292 cur = line;
293 while (merged = collapsedSpanAtEnd(cur)) {
294 var found = merged.find();
295 len -= cur.text.length - found.from.ch;
296 cur = getLine(doc, found.to.line);
297 len += cur.text.length - found.to.ch;
298 }
299 return len;
300 }
301
302 function computeMaxLength(cm) {
303 var d = cm.display, doc = cm.doc;

Callers 3

computeMaxLengthFunction · 0.70
codemirror.jsFile · 0.70

Calls 4

collapsedSpanAtStartFunction · 0.70
getLineFunction · 0.70
collapsedSpanAtEndFunction · 0.70
findMethod · 0.45

Tested by

no test coverage detected