(cm, rev)
| 92 | }); |
| 93 | } |
| 94 | function findNext(cm, rev) {cm.operation(function() { |
| 95 | var state = getSearchState(cm); |
| 96 | var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); |
| 97 | if (!cursor.find(rev)) { |
| 98 | cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0)); |
| 99 | if (!cursor.find(rev)) return; |
| 100 | } |
| 101 | cm.setSelection(cursor.from(), cursor.to()); |
| 102 | cm.scrollIntoView({from: cursor.from(), to: cursor.to()}); |
| 103 | state.posFrom = cursor.from(); state.posTo = cursor.to(); |
| 104 | });} |
| 105 | function clearSearch(cm) {cm.operation(function() { |
| 106 | var state = getSearchState(cm); |
| 107 | if (!state.query) return; |
no test coverage detected