MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / heightAtLine

Function heightAtLine

static/js/codemirror/codemirror.js:4624–4641  ·  view source on GitHub ↗
(cm, lineObj)

Source from the content-addressed store, hash-verified

4622 }
4623
4624 function heightAtLine(cm, lineObj) {
4625 lineObj = visualLine(cm.doc, lineObj);
4626
4627 var h = 0, chunk = lineObj.parent;
4628 for (var i = 0; i < chunk.lines.length; ++i) {
4629 var line = chunk.lines[i];
4630 if (line == lineObj) break;
4631 else h += line.height;
4632 }
4633 for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
4634 for (var i = 0; i < p.children.length; ++i) {
4635 var cur = p.children[i];
4636 if (cur == chunk) break;
4637 else h += cur.height;
4638 }
4639 }
4640 return h;
4641 }
4642
4643 function getOrder(line) {
4644 var order = line.order;

Callers 5

updateViewOffsetFunction · 0.85
updateSelectionRangeFunction · 0.85
intoCoordSystemFunction · 0.85
coordsCharInnerFunction · 0.85
addLineWidgetFunction · 0.85

Calls 1

visualLineFunction · 0.85

Tested by

no test coverage detected