MCPcopy Create free account
hub / github.com/breck7/scroll / getBetween

Function getBetween

external/.scrollLibs.js:989–1004  ·  view source on GitHub ↗
(doc, start, end)

Source from the content-addressed store, hash-verified

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 = []

Callers 4

historyChangeFromChangeFunction · 0.85
makeChangeSingleDocFunction · 0.85
.scrollLibs.jsFile · 0.85
walkFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected