* 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)
| 13269 | * range arguments. |
| 13270 | */ |
| 13271 | function isInRange(pos, start, end) { |
| 13272 | if (typeof pos != 'number') { |
| 13273 | // Assume it is a cursor position. Get the line number. |
| 13274 | pos = pos.line; |
| 13275 | } |
| 13276 | if (start instanceof Array) { |
| 13277 | return inArray(pos, start); |
| 13278 | } else { |
| 13279 | if (end) { |
| 13280 | return (pos >= start && pos <= end); |
| 13281 | } else { |
| 13282 | return pos == start; |
| 13283 | } |
| 13284 | } |
| 13285 | } |
| 13286 | function getUserVisibleLines(cm) { |
| 13287 | var scrollInfo = cm.getScrollInfo(); |
| 13288 | var occludeToleranceTop = 6; |