MCPcopy Index your code
hub / github.com/philc/vimium / handleEscape

Method handleEscape

content_scripts/mode_find.js:347–358  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

345 // The user has found what they're looking for and is finished searching. We enter insert mode, if
346 // possible.
347 static handleEscape() {
348 document.body.classList.remove("vimium-find-mode");
349 // Removing the class does not re-color existing selections. we recreate the current selection
350 // so it reverts back to the default color.
351 const selection = globalThis.getSelection();
352 if (!selection.isCollapsed) {
353 const range = globalThis.getSelection().getRangeAt(0);
354 globalThis.getSelection().removeAllRanges();
355 globalThis.getSelection().addRange(range);
356 }
357 return focusFoundLink() || selectFoundInputElement();
358 }
359
360 // Save the query so the user can do further searches with it.
361 static handleEnter() {

Callers 1

exitMethod · 0.80

Calls 3

focusFoundLinkFunction · 0.85
selectFoundInputElementFunction · 0.85
removeMethod · 0.80

Tested by

no test coverage detected