MCPcopy
hub / github.com/witheve/Eve / lineNo

Function lineNo

src/codemirror.js:7835–7845  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

7833 // Given a line object, find its line number by walking up through
7834 // its parent links.
7835 function lineNo(line) {
7836 if (line.parent == null) return null;
7837 var cur = line.parent, no = indexOf(cur.lines, line);
7838 for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
7839 for (var i = 0;; ++i) {
7840 if (chunk.children[i] == cur) break;
7841 no += chunk.children[i].chunkSize();
7842 }
7843 }
7844 return no + cur.first;
7845 }
7846
7847 // Find the line at the given vertical position, using the height
7848 // information in the document tree.

Callers 15

codemirror.jsFile · 0.85
locateNodeInLineViewFunction · 0.85
findFunction · 0.85
mapFromLineViewFunction · 0.85
prepareMeasureForLineFunction · 0.85
coordsCharFunction · 0.85
LineViewFunction · 0.85
changeLineFunction · 0.85
visualLineNoFunction · 0.85
visualLineEndNoFunction · 0.85

Calls 1

indexOfFunction · 0.85

Tested by

no test coverage detected