(doc, distance)
| 3364 | // Sub-views need their line numbers shifted when text is added |
| 3365 | // above or below them in the parent document. |
| 3366 | function shiftDoc(doc, distance) { |
| 3367 | doc.first += distance; |
| 3368 | doc.sel = new Selection(map(doc.sel.ranges, function(range) { |
| 3369 | return new Range(Pos(range.anchor.line + distance, range.anchor.ch), |
| 3370 | Pos(range.head.line + distance, range.head.ch)); |
| 3371 | }), doc.sel.primIndex); |
| 3372 | if (doc.cm) regChange(doc.cm, doc.first, doc.first - distance, distance); |
| 3373 | } |
| 3374 | |
| 3375 | // More lower-level change function, handling only a single document |
| 3376 | // (not linked ones). |
no test coverage detected