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

Function findNext

static/js/codemirror/addon/search/search.js:65–74  ·  view source on GitHub ↗
(cm, rev)

Source from the content-addressed store, hash-verified

63 });
64 }
65 function findNext(cm, rev) {cm.operation(function() {
66 var state = getSearchState(cm);
67 var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
68 if (!cursor.find(rev)) {
69 cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
70 if (!cursor.find(rev)) return;
71 }
72 cm.setSelection(cursor.from(), cursor.to());
73 state.posFrom = cursor.from(); state.posTo = cursor.to();
74 });}
75 function clearSearch(cm) {cm.operation(function() {
76 var state = getSearchState(cm);
77 if (!state.query) return;

Callers 1

doSearchFunction · 0.70

Calls 4

getSearchCursorFunction · 0.85
getSearchStateFunction · 0.70
operationMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected