MCPcopy Index your code
hub / github.com/csev/py4e / lineNo

Function lineNo

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:2942–2952  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

2940 return chunk.lines[n];
2941 }
2942 function lineNo(line) {
2943 if (line.parent == null) return null;
2944 var cur = line.parent, no = indexOf(cur.lines, line);
2945 for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
2946 for (var i = 0, e = chunk.children.length; ; ++i) {
2947 if (chunk.children[i] == cur) break;
2948 no += chunk.children[i].chunkSize();
2949 }
2950 }
2951 return no;
2952 }
2953 function lineAtHeight(chunk, h) {
2954 var n = 0;
2955 outer: do {

Callers 5

setSelectionFunction · 0.70
CodeMirrorFunction · 0.70
changeLineFunction · 0.70
lineInfoFunction · 0.70
codemirrorepl.jsFile · 0.70

Calls 1

indexOfFunction · 0.70

Tested by

no test coverage detected