Fix bug where searching would trigger documentation view.

Fix the bug I mentioned in the previous pull request :) 

(Oh, and if you know a better way to check this, let me know...)