From 1e5a7356f498ca3a00355687b305719e4f704fef Mon Sep 17 00:00:00 2001 From: Steve Klein Date: Fri, 20 Jul 2018 02:00:11 -0700 Subject: [PATCH] Add code snippets to search scope --- browser/lib/search.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/lib/search.js b/browser/lib/search.js index b42fd389..cf5b3b1b 100644 --- a/browser/lib/search.js +++ b/browser/lib/search.js @@ -23,7 +23,9 @@ function findByWordOrTag (notes, block) { return true } if (note.type === 'SNIPPET_NOTE') { - return note.description.match(wordRegExp) + return note.description.match(wordRegExp) || note.snippets.some((snippet) => { + return snippet.name.match(wordRegExp) || snippet.content.match(wordRegExp) + }) } else if (note.type === 'MARKDOWN_NOTE') { return note.content.match(wordRegExp) }