(doc, start, end)
| 18 | // Get the part of a document between two positions, as an array of |
| 19 | // strings. |
| 20 | export function getBetween(doc, start, end) { |
| 21 | let out = [], n = start.line |
| 22 | doc.iter(start.line, end.line + 1, line => { |
| 23 | let text = line.text |
| 24 | if (n == end.line) text = text.slice(0, end.ch) |
| 25 | if (n == start.line) text = text.slice(start.ch) |
| 26 | out.push(text) |
| 27 | ++n |
| 28 | }) |
| 29 | return out |
| 30 | } |
| 31 | // Get the lines between from and to, as array of strings. |
| 32 | export function getLines(doc, from, to) { |
| 33 | let out = [] |
no test coverage detected