Fixes search when entering an empty string or when dismissing the search dialog

Hi Patrick
thanks for sharing this plugin. Works very well. 

However, I found a small issue in the search dialog, Find my fix enclosed. FWIW my IDE ate the last newline character.

regards
Marian