(doc, start, end)
| 987 | // Get the part of a document between two positions, as an array of |
| 988 | // strings. |
| 989 | function getBetween(doc, start, end) { |
| 990 | var out = [], |
| 991 | n = start.line |
| 992 | doc.iter(start.line, end.line + 1, function (line) { |
| 993 | var text = line.text |
| 994 | if (n == end.line) { |
| 995 | text = text.slice(0, end.ch) |
| 996 | } |
| 997 | if (n == start.line) { |
| 998 | text = text.slice(start.ch) |
| 999 | } |
| 1000 | out.push(text) |
| 1001 | ++n |
| 1002 | }) |
| 1003 | return out |
| 1004 | } |
| 1005 | // Get the lines between from and to, as array of strings. |
| 1006 | function getLines(doc, from, to) { |
| 1007 | var out = [] |
no test coverage detected