MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / activateSearch

Function activateSearch

frontend/app/store/keymodel.ts:699–718  ·  view source on GitHub ↗
(event: WaveKeyboardEvent)

Source from the content-addressed store, hash-verified

697 });
698 }
699 function activateSearch(event: WaveKeyboardEvent): boolean {
700 const bcm = getBlockComponentModel(getFocusedBlockInStaticTab());
701 // Ctrl+f is reserved in most shells
702 if (event.control && bcm.viewModel.viewType == "term") {
703 return false;
704 }
705 if (bcm.viewModel.searchAtoms) {
706 if (globalStore.get(bcm.viewModel.searchAtoms.isOpen)) {
707 // Already open — increment the focusInput counter so this block's
708 // SearchComponent focuses its own input (avoids a global DOM query
709 // that could target the wrong block when multiple searches are open).
710 const cur = globalStore.get(bcm.viewModel.searchAtoms.focusInput) as number;
711 globalStore.set(bcm.viewModel.searchAtoms.focusInput, cur + 1);
712 } else {
713 globalStore.set(bcm.viewModel.searchAtoms.isOpen, true);
714 }
715 return true;
716 }
717 return false;
718 }
719 function deactivateSearch(): boolean {
720 const bcm = getBlockComponentModel(getFocusedBlockInStaticTab());
721 if (bcm.viewModel.searchAtoms && globalStore.get(bcm.viewModel.searchAtoms.isOpen)) {

Callers

nothing calls this directly

Calls 4

getBlockComponentModelFunction · 0.90
getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected