Skip to content

Prevent "research" from generating matches if search string is zero-length #172

@sasumner

Description

@sasumner

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions