MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / removeSearch

Function removeSearch

src/handlers/quickTools.js:496–522  ·  view source on GitHub ↗

* Removes search bar from footer

()

Source from the content-addressed store, hash-verified

494 * Removes search bar from footer
495 */
496function removeSearch() {
497 const { $footer, $searchRow1, $searchRow2 } = quickTools;
498
499 if (!$footer.contains($searchRow1)) return;
500 actionStack.remove("search-bar");
501 $footer.removeAttribute("data-searching");
502 $searchRow1.remove();
503 $searchRow2.remove();
504
505 // Reset history navigation when search is closed
506 searchHistory.resetAllNavigation();
507
508 const { activeFile, editor } = editorManager;
509
510 // Check if current tab is a terminal
511 if (
512 activeFile &&
513 activeFile.type === "terminal" &&
514 activeFile.terminalComponent
515 ) {
516 activeFile.terminalComponent.searchAddon?.clearDecorations();
517 activeFile.terminalComponent.searchAddon?.clearActiveDecoration();
518 return;
519 }
520 clearSearchQuery(editor);
521 focusEditor();
522}
523
524/**
525 * Finds the next/previous search result

Callers 1

toggleSearchFunction · 0.85

Calls 4

clearSearchQueryFunction · 0.85
focusEditorFunction · 0.85
resetAllNavigationMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected