MCPcopy Create free account
hub / github.com/massCodeIO/massCode / selectSearchSnippet

Function selectSearchSnippet

src/renderer/composables/useSnippets.ts:752–765  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

750}
751
752function selectSearchSnippet(index: number) {
753 if (
754 !displayedSnippets.value
755 || index < 0
756 || index >= displayedSnippets.value.length
757 ) {
758 return
759 }
760
761 const snippet = displayedSnippets.value[index]
762 selectSnippet(snippet.id)
763 searchSelectedIndex.value = index
764 nextTick(() => scrollToSnippetIndex(index))
765}
766
767function clearSearch(restoreState = false) {
768 if (restoreState && !isRestoreStateBlocked.value) {

Callers

nothing calls this directly

Calls 2

scrollToSnippetIndexFunction · 0.90
selectSnippetFunction · 0.85

Tested by

no test coverage detected