Update the replace() method to (1) be more "greedy" when searching for matches in the text, including multi-line matches; and (2) fix the write back to the file.
Currently, it is possible that, if we have a smaller size than the original file size, we will end up writing:
-> and this file still has the same size as it original.
This PR simplifies the logic to decide how to write the changed content.
Closes #483
Update the
replace()
method to (1) be more "greedy" when searching for matches in the text, including multi-line matches; and (2) fix the write back to the file.Currently, it is possible that, if we have a smaller size than the original file size, we will end up writing: