Prevent "research" from generating matches if search string is zero-length
With this code:
matches = []
editor.research('', lambda m: matches.append(m.span(0)))
print(len(matches))
I was semi-surprised to see a non-zero result printed.
Any chance that the plugin could trap on this situation and not match anything? Same for ".search()" and ".replace()" and ".rereplace()" as well, of course.
Obviously I can do that trapping as well, before calling.
@sasumner With which version of the plugin? python2.7 aka 1.5.4 or a python3 beta release?
@chcg
Ach--sorry for omitting that. I'm still using Python 2.7 / 1.5.4
But, I would expect the newer would still work the same way?
Again, I wouldn't call it a "bug", but it might be a nice convenience for the user to trap this. Notepad++ itself doesn't return any matches if Find what is empty and a Find Next is done.