MCPcopy
hub / github.com/DHTMLX/gantt / getLine

Function getLine

samples/common/codehighlight/codemirror.js:891–903  ·  view source on GitHub ↗
(doc, n)

Source from the content-addressed store, hash-verified

889
890 // Find the line object corresponding to the given line number.
891 function getLine(doc, n) {
892 n -= doc.first;
893 if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") }
894 var chunk = doc;
895 while (!chunk.lines) {
896 for (var i = 0;; ++i) {
897 var child = chunk.children[i], sz = child.chunkSize();
898 if (n < sz) { chunk = child; break }
899 n -= sz;
900 }
901 }
902 return chunk.lines[n]
903 }
904
905 // Get the part of a document between two positions, as an array of
906 // strings.

Callers 15

clipPosFunction · 0.85
getContextBeforeFunction · 0.85
takeTokenFunction · 0.85
findStartLineFunction · 0.85
retreatFrontierFunction · 0.85
stretchSpansOverChangeFunction · 0.85
visualLineNoFunction · 0.85
visualLineEndNoFunction · 0.85
findMaxLineFunction · 0.85
buildViewArrayFunction · 0.85
charCoordsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected