Open codecoll opened 2 years ago
It's not an artefact really, it is all the locations that match. If you hit enter and start typing the replacement, you will see the replacement appear in all those locations.
I disabled rendering these with the initial empty pattern as that would be a bit too distracting imho, as most of the time you want to actually search for a non-empty string.
Highlighting the empty pattern seems unecessary, since if one wants to replace the empty string then one knows it matches after every character, so it does not give any useful information.
Shouldn't it work like the initial empty pattern, so it's consistent? I thought it was a bug, because it added | characters when I deleted the pattern which I didn't understand, since the user expects that by deleting the pattern one gets back to the inital state.
since if one wants to replace the empty string then one knows it matches after every character
Same could be said for any other pattern, but this package is here to give visual feedback on your pattern. Explicit is better than implicit.
Shouldn't it work like the initial empty pattern, so it's consistent?
It could, but this is why I wrote:
I disabled rendering these with the initial empty pattern as that would be a bit too distracting imho, as most of the time you want to actually search for a non-empty string.
It is inconsistent though for sure.
I don't have a very strong opinion. Feel free to open a PR if you think it's worth it (but only for the empty pattern, there can be other zero-width patterns that should still be rendered).