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

Function clearSearchHighlight

static/js/codemirror/keymap/vim.js:2136–2156  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

2134 return cursor.from();
2135 });}
2136 function clearSearchHighlight(cm) {
2137 if (cm.addOverlay) {
2138 cm.removeOverlay(getSearchState(cm).getOverlay());
2139 getSearchState(cm).setOverlay(null);
2140 } else {
2141 cm.operation(function() {
2142 var state = getSearchState(cm);
2143 if (!state.getQuery()) {
2144 return;
2145 }
2146 var marked = state.getMarked();
2147 if (!marked) {
2148 return;
2149 }
2150 for (var i = 0; i < marked.length; ++i) {
2151 marked[i].clear();
2152 }
2153 state.setMarked(null);
2154 });
2155 }
2156 }
2157 /**
2158 * Check if pos is in the specified range, INCLUSIVE.
2159 * Range can be specified with 1 or 2 arguments.

Callers 2

updateSearchQueryFunction · 0.85
VimFunction · 0.85

Calls 3

getSearchStateFunction · 0.70
operationMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected