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

Function nextChar

lib/web/CodeMirror/keymap/vim.js:3814–3829  ·  view source on GitHub ↗
(cm, idx)

Source from the content-addressed store, hash-verified

3812 no more valid positions.
3813 */
3814 function nextChar(cm, idx) {
3815 if (idx.pos + idx.dir < 0 || idx.pos + idx.dir >= idx.line.length) {
3816 idx.ln += idx.dir;
3817 if (!isLine(cm, idx.ln)) {
3818 idx.line = null;
3819 idx.ln = null;
3820 idx.pos = null;
3821 return;
3822 }
3823 idx.line = cm.getLine(idx.ln);
3824 idx.pos = (idx.dir > 0) ? 0 : idx.line.length - 1;
3825 }
3826 else {
3827 idx.pos += idx.dir;
3828 }
3829 }
3830
3831 /*
3832 Performs one iteration of traversal in forward direction

Callers 2

forwardFunction · 0.85
reverseFunction · 0.85

Calls 2

isLineFunction · 0.70
getLineMethod · 0.65

Tested by

no test coverage detected