** When using hideshow.el, incremental search can temporarily show hidden
blocks if a match is inside the block.

The block is hidden again if the search is continued and the next match is outside the block. By customizing the variable isearch-hide-immediately you can choose to hide all the temporarily shown blocks only when exiting from incremental search.

By customizing the variable hs-isearch-open you can choose what kind of blocks to temporarily show during isearch: comment blocks, code blocks, all of them or none.