Closed Destroy666x closed 1 year ago
You can also just check the box "create backup files" and do the replacement. Then if it's not what you expected you can restore the backups.
It's a good option for security indeed. Not great for quickly checking all the changes though, when replacing in a lot of files, hundreds or thousands.
So, think about this:
... button that would show **all** the effects of replaces that will be executed in **all** files ...
and then
... when replacing in a lot of files, **hundreds or thousands**.
now imagine e.g. ten thousand files with a hundred replacements in each. No only would that use up a lot of memory, but how would you show that to the user? And be honest: would you be able to spot your edge cases in so many replacements?
So I don't really see any real benefits in such a feature.
now imagine e.g. ten thousand files with a hundred replacements in each. No only would that use up a lot of memory,
Could set some limits to avoid memory issues.
but how would you show that to the user?
Bunch of possibilities. Pagination is one.
And be honest: would you be able to spot your edge cases in so many replacements?
In my case of ~300 files with 1 change in most and max few in some - definitely, it would be very helpful, otherwise I wouldn't request this. With thousands or more I agree it'd be less since i'ts unlikely many people would look through so many changes.
Whenever I do a complex regex with this tool, I'm scared that I might be missing some edge case. It would be nice if there was a dropdown for
Replace
button that would show all the effects of replaces that will be executed in all files, as mistakes can happen even if you carefully test on regex101.I saw that a similar feature request got rejected because there's
Test regex
: https://github.com/stefankueng/grepWin/issues/56#issuecomment-436777680 This is not the same at all because you can't copy all the matched lines there, at least I don't see an easy way for it. It could of course reuse that window, why not, and automatically insert all the matched lines there as inputs.