(cm, pos, dir, unit)
| 2864 | } |
| 2865 | |
| 2866 | function findPosV(cm, pos, dir, unit) { |
| 2867 | var doc = cm.doc, x = pos.left, y; |
| 2868 | if (unit == "page") { |
| 2869 | var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); |
| 2870 | y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); |
| 2871 | } else if (unit == "line") { |
| 2872 | y = dir > 0 ? pos.bottom + 3 : pos.top - 3; |
| 2873 | } |
| 2874 | for (;;) { |
| 2875 | var target = coordsChar(cm, x, y); |
| 2876 | if (!target.outside) break; |
| 2877 | if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } |
| 2878 | y += dir * 5; |
| 2879 | } |
| 2880 | return target; |
| 2881 | } |
| 2882 | |
| 2883 | function findWordAt(line, pos) { |
| 2884 | var start = pos.ch, end = pos.ch; |
no test coverage detected