(dir, unit)
| 1488 | } |
| 1489 | var goalColumn = null; |
| 1490 | function moveV(dir, unit) { |
| 1491 | var dist = 0, pos = localCoords(sel.inverted ? sel.from : sel.to, true); |
| 1492 | if (goalColumn != null) pos.x = goalColumn; |
| 1493 | if (unit == "page") dist = Math.min(scroller.clientHeight, window.innerHeight || document.documentElement.clientHeight); |
| 1494 | else if (unit == "line") dist = textHeight(); |
| 1495 | var target = coordsChar(pos.x, pos.y + dist * dir + 2); |
| 1496 | if (unit == "page") scroller.scrollTop += localCoords(target, true).y - pos.y; |
| 1497 | setCursor(target.line, target.ch, true); |
| 1498 | goalColumn = pos.x; |
| 1499 | } |
| 1500 | |
| 1501 | function selectWordAt(pos) { |
| 1502 | var line = getLine(pos.line).text; |
nothing calls this directly
no test coverage detected