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

Function lineAtHeight

tools/pythonauto/static/codemirror/codemirror.js:5254–5271  ·  view source on GitHub ↗
(chunk, h)

Source from the content-addressed store, hash-verified

5252 }
5253
5254 function lineAtHeight(chunk, h) {
5255 var n = chunk.first;
5256 outer: do {
5257 for (var i = 0, e = chunk.children.length; i < e; ++i) {
5258 var child = chunk.children[i], ch = child.height;
5259 if (h < ch) { chunk = child; continue outer; }
5260 h -= ch;
5261 n += child.chunkSize();
5262 }
5263 return n;
5264 } while (!chunk.lines);
5265 for (var i = 0, e = chunk.lines.length; i < e; ++i) {
5266 var line = chunk.lines[i], lh = line.height;
5267 if (h < lh) break;
5268 h -= lh;
5269 }
5270 return n + i;
5271 }
5272
5273 function heightAtLine(cm, lineObj) {
5274 lineObj = visualLine(cm.doc, lineObj);

Callers 4

visibleLinesFunction · 0.70
coordsCharFunction · 0.70
gutterEventFunction · 0.70
codemirror.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected