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

Function highlightSearchMatches

lib/web/CodeMirror/keymap/vim.js:4398–4418  ·  view source on GitHub ↗
(cm, query)

Source from the content-addressed store, hash-verified

4396 }
4397 var highlightTimeout = 0;
4398 function highlightSearchMatches(cm, query) {
4399 clearTimeout(highlightTimeout);
4400 highlightTimeout = setTimeout(function() {
4401 var searchState = getSearchState(cm);
4402 var overlay = searchState.getOverlay();
4403 if (!overlay || query != overlay.query) {
4404 if (overlay) {
4405 cm.removeOverlay(overlay);
4406 }
4407 overlay = searchOverlay(query);
4408 cm.addOverlay(overlay);
4409 if (cm.showMatchesOnScrollbar) {
4410 if (searchState.getScrollbarAnnotate()) {
4411 searchState.getScrollbarAnnotate().clear();
4412 }
4413 searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query));
4414 }
4415 searchState.setOverlay(overlay);
4416 }
4417 }, 50);
4418 }
4419 function findNext(cm, prev, query, repeat) {
4420 if (repeat === undefined) { repeat = 1; }
4421 return cm.operation(function() {

Callers 2

VimFunction · 0.85
updateSearchQueryFunction · 0.85

Calls 3

getSearchStateFunction · 0.70
searchOverlayFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected