(cm, from, to)
| 5719 | // Force the view to cover a given range, adding empty view element |
| 5720 | // or clipping off existing ones as needed. |
| 5721 | function adjustView(cm, from, to) { |
| 5722 | var display = cm.display, |
| 5723 | view = display.view |
| 5724 | if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { |
| 5725 | display.view = buildViewArray(cm, from, to) |
| 5726 | display.viewFrom = from |
| 5727 | } else { |
| 5728 | if (display.viewFrom > from) { |
| 5729 | display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) |
| 5730 | } else if (display.viewFrom < from) { |
| 5731 | display.view = display.view.slice(findViewIndex(cm, from)) |
| 5732 | } |
| 5733 | display.viewFrom = from |
| 5734 | if (display.viewTo < to) { |
| 5735 | display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) |
| 5736 | } else if (display.viewTo > to) { |
| 5737 | display.view = display.view.slice(0, findViewIndex(cm, to)) |
| 5738 | } |
| 5739 | } |
| 5740 | display.viewTo = to |
| 5741 | } |
| 5742 | |
| 5743 | // Count the number of lines in the view whose DOM representation is |
| 5744 | // out of date (or nonexistent). |
no test coverage detected