Skip to content

Commit

Permalink
Merge pull request BoostIO#2226 from sklein12/addSnippetToSearchScope
Browse files Browse the repository at this point in the history
Add code snippets to search scope
  • Loading branch information
Rokt33r authored Aug 9, 2018
2 parents 612de84 + 1e5a735 commit cfe3cae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion browser/lib/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit cfe3cae

Please sign in to comment.