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

Function visibleLines

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

Source from the content-addressed store, hash-verified

917 }
918
919 function visibleLines() {
920 var lh = textHeight(), top = scroller.scrollTop - paddingTop();
921 var fromHeight = Math.max(0, Math.floor(top / lh));
922 var toHeight = Math.ceil((top + scroller.clientHeight) / lh);
923 return {from: lineAtHeight(doc, fromHeight),
924 to: lineAtHeight(doc, toHeight)};
925 }
926 // Uses a set of changes plus the current scroll position to
927 // determine which DOM updates have to be made, and makes the
928 // updates.

Callers 2

extendFunction · 0.85
updateDisplayFunction · 0.85

Calls 3

textHeightFunction · 0.85
paddingTopFunction · 0.85
lineAtHeightFunction · 0.85

Tested by

no test coverage detected