MCPcopy
hub / github.com/nwutils/nw-sample-apps / scrollCursorIntoView

Function scrollCursorIntoView

mini-code-edit/cm/lib/codemirror.js:890–894  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

888 if (rect.top < 0 || rect.bottom > winH) cursor.scrollIntoView();
889 }
890 function scrollCursorIntoView() {
891 var cursor = localCoords(sel.inverted ? sel.from : sel.to);
892 var x = options.lineWrapping ? Math.min(cursor.x, lineSpace.offsetWidth) : cursor.x;
893 return scrollIntoView(x, cursor.y, x, cursor.yBot);
894 }
895 function scrollIntoView(x1, y1, x2, y2) {
896 var pl = paddingLeft(), pt = paddingTop();
897 y1 += pt; y2 += pt; x1 += pl; x2 += pl;

Callers 1

endOperationFunction · 0.85

Calls 2

localCoordsFunction · 0.85
scrollIntoViewFunction · 0.85

Tested by

no test coverage detected