MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / shiftDoc

Function shiftDoc

static/js/codemirror/codemirror.js:2177–2183  ·  view source on GitHub ↗
(doc, distance)

Source from the content-addressed store, hash-verified

2175 }
2176
2177 function shiftDoc(doc, distance) {
2178 function shiftPos(pos) {return Pos(pos.line + distance, pos.ch);}
2179 doc.first += distance;
2180 if (doc.cm) regChange(doc.cm, doc.first, doc.first, distance);
2181 doc.sel.head = shiftPos(doc.sel.head); doc.sel.anchor = shiftPos(doc.sel.anchor);
2182 doc.sel.from = shiftPos(doc.sel.from); doc.sel.to = shiftPos(doc.sel.to);
2183 }
2184
2185 function makeChangeSingleDoc(doc, change, selAfter, spans) {
2186 if (doc.cm && !doc.cm.curOp)

Callers 1

makeChangeSingleDocFunction · 0.85

Calls 2

regChangeFunction · 0.85
shiftPosFunction · 0.85

Tested by

no test coverage detected