MCPcopy Index your code
hub / github.com/DHTMLX/gantt / movePos

Function movePos

samples/common/codehighlight/codemirror.js:5214–5224  ·  view source on GitHub ↗
(doc, pos, dir, line)

Source from the content-addressed store, hash-verified

5212 }
5213
5214 function movePos(doc, pos, dir, line) {
5215 if (dir < 0 && pos.ch == 0) {
5216 if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }
5217 else { return null }
5218 } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {
5219 if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }
5220 else { return null }
5221 } else {
5222 return new Pos(pos.line, pos.ch + dir)
5223 }
5224 }
5225
5226 function selectAll(cm) {
5227 cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);

Callers 1

skipAtomicInnerFunction · 0.85

Calls 3

clipPosFunction · 0.85
PosFunction · 0.85
getLineFunction · 0.85

Tested by

no test coverage detected