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

Function getLine

src/codemirror.js:7793–7804  ·  view source on GitHub ↗
(doc, n)

Source from the content-addressed store, hash-verified

7791
7792 // Find the line object corresponding to the given line number.
7793 function getLine(doc, n) {
7794 n -= doc.first;
7795 if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document.");
7796 for (var chunk = doc; !chunk.lines;) {
7797 for (var i = 0;; ++i) {
7798 var child = chunk.children[i], sz = child.chunkSize();
7799 if (n < sz) { chunk = child; break; }
7800 n -= sz;
7801 }
7802 }
7803 return chunk.lines[n];
7804 }
7805
7806 // Get the part of a document between two positions, as an array of
7807 // strings.

Callers 15

findMaxLineFunction · 0.85
visibleLinesFunction · 0.85
updateDisplayIfNeededFunction · 0.85
applyTextInputFunction · 0.85
triggerElectricFunction · 0.85
codemirror.jsFile · 0.85
posToDOMFunction · 0.85
clipPosFunction · 0.85
skipAtomicInnerFunction · 0.85
movePosFunction · 0.85
drawForLineFunction · 0.85
drawSelectionRangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected