MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / getBetween

Function getBetween

lib/web/CodeMirror/src/line/utils_line.js:20–30  ·  view source on GitHub ↗
(doc, start, end)

Source from the content-addressed store, hash-verified

18// Get the part of a document between two positions, as an array of
19// strings.
20export 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.
32export function getLines(doc, from, to) {
33 let out = []

Callers 5

Doc.jsFile · 0.90
historyChangeFromChangeFunction · 0.90
makeChangeSingleDocFunction · 0.90
pollContentMethod · 0.90
walkFunction · 0.90

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected