MCPcopy Create free account
hub / github.com/witheve/Eve / moveToCharacter

Function moveToCharacter

src/codemirror.js:12701–12714  ·  view source on GitHub ↗
(cm, repeat, forward, character)

Source from the content-addressed store, hash-verified

12699 }
12700
12701 function moveToCharacter(cm, repeat, forward, character) {
12702 var cur = cm.getCursor();
12703 var start = cur.ch;
12704 var idx;
12705 for (var i = 0; i < repeat; i ++) {
12706 var line = cm.getLine(cur.line);
12707 idx = charIdxInLine(start, line, character, forward, true);
12708 if (idx == -1) {
12709 return null;
12710 }
12711 start = idx;
12712 }
12713 return Pos(cm.getCursor().line, idx);
12714 }
12715
12716 function moveToColumn(cm, repeat) {
12717 // repeat is always >= 1, so repeat - 1 always corresponds

Callers 1

VimFunction · 0.85

Calls 3

charIdxInLineFunction · 0.85
getCursorMethod · 0.80
getLineMethod · 0.80

Tested by

no test coverage detected