MCPcopy
hub / github.com/csev/py4e / visibleLines

Function visibleLines

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:1119–1125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1117 }
1118
1119 function visibleLines() {
1120 var lh = textHeight(), top = scroller.scrollTop - paddingTop();
1121 var fromHeight = Math.max(0, Math.floor(top / lh));
1122 var toHeight = Math.ceil((top + scroller.clientHeight) / lh);
1123 return {from: lineAtHeight(doc, fromHeight),
1124 to: lineAtHeight(doc, toHeight)};
1125 }
1126 // Uses a set of changes plus the current scroll position to
1127 // determine which DOM updates have to be made, and makes the
1128 // updates.

Callers 2

extendFunction · 0.70
updateDisplayFunction · 0.70

Calls 3

textHeightFunction · 0.70
paddingTopFunction · 0.70
lineAtHeightFunction · 0.70

Tested by

no test coverage detected