Closed ghost closed 3 years ago
Thanks for letting me know. As you've probably surmised, this happens because searching for an empty string matches at the beginning of the string, and continues matching the same offset without making progress.
I think the best fix for the two tools is a bit different though:
repl
, it doesn't make much sense to replace an empty string with something, so this command should fail.hilite
, it does make some sense to highlight the entire line with an empty string, which would match all lines allowing them to be displayed in color. However, highlighting a specific term that is empty makes no sense. Rather than fail completely, I think this should just not match and continue executing.I'll push some changes for these over the next couple days.
I pushed commit 1d494c25673f58d8c13fa3195320fb69ee5c13dc and 67405c6fd98beace8200a51b6ae591d1e51e6be4 for these. Please let me know if you encounter any issues after these commits.
1.60 is in stable now. Please reopen or file another issue if there's still something broken or missing here.
ver | repl "" ""
hangsver | hilite -c "" green
does not hang and colors the entire output with specified colorver | hilite -c "" green -m
hangs