MCPcopy
hub / github.com/hokein/electron-sample-apps / lineNo

Function lineNo

mini-code-editor/cm/lib/codemirror.js:2742–2752  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

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);
2745 for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
2746 for (var i = 0, e = chunk.children.length; ; ++i) {
2747 if (chunk.children[i] == cur) break;
2748 no += chunk.children[i].chunkSize();
2749 }
2750 }
2751 return no;
2752 }
2753 function lineAtHeight(chunk, h) {
2754 var n = 0;
2755 outer: do {

Callers 5

setSelectionFunction · 0.85
CodeMirrorFunction · 0.85
changeLineFunction · 0.85
lineInfoFunction · 0.85
codemirror.jsFile · 0.85

Calls 1

indexOfFunction · 0.70

Tested by

no test coverage detected