MCPcopy Index your code
hub / github.com/DHTMLX/gantt / lineNo

Function lineNo

samples/common/codehighlight/codemirror.js:934–944  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

932 // Given a line object, find its line number by walking up through
933 // its parent links.
934 function lineNo(line) {
935 if (line.parent == null) { return null }
936 var cur = line.parent, no = indexOf(cur.lines, line);
937 for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
938 for (var i = 0;; ++i) {
939 if (chunk.children[i] == cur) { break }
940 no += chunk.children[i].chunkSize();
941 }
942 }
943 return no + cur.first
944 }
945
946 // Find the line at the given vertical position, using the height
947 // information in the document tree.

Callers 15

getLineStylesFunction · 0.85
visualLineNoFunction · 0.85
visualLineEndNoFunction · 0.85
codemirror.jsFile · 0.85
buildLineContentFunction · 0.85
LineViewFunction · 0.85
mapFromLineViewFunction · 0.85
prepareMeasureForLineFunction · 0.85
changeLineFunction · 0.85
addLineWidgetFunction · 0.85

Calls 1

indexOfFunction · 0.85

Tested by

no test coverage detected