* Check if pos is in the specified range, INCLUSIVE. * Range can be specified with 1 or 2 arguments. * If the first range argument is an array, treat it as an array of line * numbers. Match pos against any of the lines. * If the first range argument is a number, * if there
(pos, start, end)
| 4494 | * range arguments. |
| 4495 | */ |
| 4496 | function isInRange(pos, start, end) { |
| 4497 | if (typeof pos != 'number') { |
| 4498 | // Assume it is a cursor position. Get the line number. |
| 4499 | pos = pos.line; |
| 4500 | } |
| 4501 | if (start instanceof Array) { |
| 4502 | return inArray(pos, start); |
| 4503 | } else { |
| 4504 | if (end) { |
| 4505 | return (pos >= start && pos <= end); |
| 4506 | } else { |
| 4507 | return pos == start; |
| 4508 | } |
| 4509 | } |
| 4510 | } |
| 4511 | function getUserVisibleLines(cm) { |
| 4512 | var scrollInfo = cm.getScrollInfo(); |
| 4513 | var occludeToleranceTop = 6; |