(event: WaveKeyboardEvent)
| 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)) { |
nothing calls this directly
no test coverage detected