MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / visibleLines

Function visibleLines

static/js/codemirror/codemirror.js:347–354  ·  view source on GitHub ↗
(display, doc, viewPort)

Source from the content-addressed store, hash-verified

345 }
346
347 function visibleLines(display, doc, viewPort) {
348 var top = display.scroller.scrollTop, height = display.wrapper.clientHeight;
349 if (typeof viewPort == "number") top = viewPort;
350 else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;}
351 top = Math.floor(top - paddingTop(display));
352 var bottom = Math.ceil(top + height);
353 return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)};
354 }
355
356 // LINE NUMBERS
357

Callers 2

updateDisplayInnerFunction · 0.85
extendFunction · 0.85

Calls 2

paddingTopFunction · 0.85
lineAtHeightFunction · 0.85

Tested by

no test coverage detected