(cm)
| 137 | // 'simulates' scrolling that position into view in a cheap way, so |
| 138 | // that the effect of intermediate scroll commands is not ignored. |
| 139 | function resolveScrollToPos(cm) { |
| 140 | let range = cm.curOp.scrollToPos |
| 141 | if (range) { |
| 142 | cm.curOp.scrollToPos = null |
| 143 | let from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to) |
| 144 | scrollToCoordsRange(cm, from, to, range.margin) |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | export function scrollToCoordsRange(cm, from, to, margin) { |
| 149 | let sPos = calculateScrollPos(cm, { |
no test coverage detected