MCPcopy
hub / github.com/nwutils/nw-sample-apps / getLineAt

Function getLineAt

mini-code-edit/cm/lib/codemirror.js:2732–2741  ·  view source on GitHub ↗
(chunk, n)

Source from the content-addressed store, hash-verified

2730 };
2731
2732 function getLineAt(chunk, n) {
2733 while (!chunk.lines) {
2734 for (var i = 0;; ++i) {
2735 var child = chunk.children[i], sz = child.chunkSize();
2736 if (n < sz) { chunk = child; break; }
2737 n -= sz;
2738 }
2739 }
2740 return chunk.lines[n];
2741 }
2742 function lineNo(line) {
2743 if (line.parent == null) return null;
2744 var cur = line.parent, no = indexOf(cur.lines, line);

Callers 1

getLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected