* Removes search bar from footer
()
| 494 | * Removes search bar from footer |
| 495 | */ |
| 496 | function 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 |
no test coverage detected